getting resources to work
This commit is contained in:
parent
4e614d2f5f
commit
7422d62fa4
|
@ -1,10 +1,14 @@
|
|||
#lang planet dyoo/whalesong
|
||||
|
||||
(require (planet dyoo/whalesong/resource))
|
||||
(require (planet dyoo/whalesong/resource)
|
||||
(planet dyoo/whalesong/image))
|
||||
|
||||
(define-resource whale-resource "images/humpback.jpg")
|
||||
|
||||
#;(define whale-image
|
||||
(image-url
|
||||
(resource->url whale-resource)))
|
||||
(define whale-image
|
||||
(image-url
|
||||
(resource->url whale-resource)))
|
||||
|
||||
whale-resource
|
||||
whale-image
|
||||
whale-image
|
|
@ -5,6 +5,6 @@
|
|||
net/url)
|
||||
|
||||
|
||||
|
||||
;; resource->url: resource -> string
|
||||
(define (resource->url r)
|
||||
(path->url (resource-path r)))
|
||||
(url->string (path->url (resource-path r))))
|
||||
|
|
|
@ -120,6 +120,10 @@
|
|||
(lambda (r)
|
||||
(make-directory* (current-resource-dir))
|
||||
(log-info (format "Writing resource ~s" (resource-path r)))
|
||||
(when (file-exists? (build-path (current-resource-dir)
|
||||
(resource-key r)))
|
||||
(delete-file (build-path (current-resource-dir)
|
||||
(resource-key r))))
|
||||
(copy-file (resource-path r)
|
||||
(build-path (current-resource-dir)
|
||||
(resource-key r))))])
|
||||
|
|
Loading…
Reference in New Issue
Block a user