Created
October 16, 2011 13:15
-
-
Save tricknotes/1290866 to your computer and use it in GitHub Desktop.
CoffeeScriptをコンパイルするwatchr
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
require "open3" | |
watch('(.*)\.coffee') do |md| | |
stdin, stdout, stderr = Open3.popen3("coffee -o dist/js/ -c #{md[0]}") | |
error_message = '' | |
unless stderr.eof? | |
error_message << stderr.to_a.join | |
end | |
system "growlnotify", "-t", md[0], "-m", error_message.empty? ? 'Compiled successfully': error_message | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment