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