Created
February 16, 2012 20:35
-
-
Save bookshelfdave/1847649 to your computer and use it in GitHub Desktop.
Whalesong changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define watch | |
(lambda (watch-file (lastmod 0)) | |
(let | |
([currentmod (file-or-directory-modify-seconds watch-file)]) | |
(begin | |
(if (not (equal? lastmod currentmod)) | |
(begin | |
(print "Compiling file\n") | |
(sleep 1) | |
(watch watch-file (file-or-directory-modify-seconds watch-file))) | |
(begin | |
(sleep 1) | |
(watch watch-file lastmod))))))) | |
[("-w" "--watch") | |
("Watch a file and recompile if changed") | |
(current-watch-file? #t)] | |
(current-command-line-arguments (vector "build" "-w" "c:\\src\\wstest\\hello.rkt")) | |
;; Enable watching a file to recomile as needed | |
(: current-watch-file? (Parameterof Boolean)) | |
(define current-watch-file? (make-parameter #f)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment