getting resources to work

This commit is contained in:
Danny Yoo 2011-08-12 17:22:33 -04:00
parent 4e614d2f5f
commit 7422d62fa4
3 changed files with 14 additions and 6 deletions

View File

@ -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
(define whale-image
(image-url
(resource->url whale-resource)))
whale-resource
whale-image
whale-image

View File

@ -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))))

View File

@ -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))))])