Skip to content

Instantly share code, notes, and snippets.

@bookshelfdave
Created February 16, 2012 20:35
Show Gist options
  • Save bookshelfdave/1847649 to your computer and use it in GitHub Desktop.
Save bookshelfdave/1847649 to your computer and use it in GitHub Desktop.
Whalesong changes
(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