slightly more robust way to build the paths

This commit is contained in:
Danny Yoo 2011-10-03 14:10:12 -04:00
parent 0eab74e2e0
commit a254acf05f

View File

@ -118,8 +118,10 @@
(let ([n 0]) (let ([n 0])
(lambda () (lambda ()
(define result (build-path (current-output-dir) (define result (build-path (current-output-dir)
(string-append
(regexp-replace #rx"[.](rkt|ss)$" (regexp-replace #rx"[.](rkt|ss)$"
(path->string (file-name-from-path f)) (path->string (file-name-from-path f))
"")
(if (= n 0) (if (= n 0)
".js" ".js"
(format "_~a.js" n))))) (format "_~a.js" n)))))
@ -162,13 +164,16 @@
"")] "")]
[output-html-filename [output-html-filename
(build-path (build-path
(regexp-replace #rx"[.](rkt|ss)$" (string-append (regexp-replace #rx"[.](rkt|ss)$"
(path->string (file-name-from-path f)) (path->string (file-name-from-path f))
"")
".html"))] ".html"))]
[output-manifest-filename [output-manifest-filename
(build-path (build-path
(string-append
(regexp-replace #rx"[.](rkt|ss)$" (regexp-replace #rx"[.](rkt|ss)$"
(path->string (file-name-from-path f)) (path->string (file-name-from-path f))
"")
".appcache"))]) ".appcache"))])
(unless (directory-exists? (current-output-dir)) (unless (directory-exists? (current-output-dir))
(fprintf (current-report-port) "Creating destination directory ~s\n" (current-output-dir)) (fprintf (current-report-port) "Creating destination directory ~s\n" (current-output-dir))