mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-02-18 19:34:27 -05:00
clean up children at exit -- had about twenty processes all watching and recompiling the docs
This commit is contained in:
4
Rakefile
4
Rakefile
@@ -18,7 +18,9 @@ end
|
|||||||
desc "Build the documentation page"
|
desc "Build the documentation page"
|
||||||
task :doc do
|
task :doc do
|
||||||
source = 'documentation/index.html.erb'
|
source = 'documentation/index.html.erb'
|
||||||
Thread.new { `bin/coffee-script documentation/cs/*.cs -o documentation/js -w` }
|
child = fork { exec "bin/coffee-script documentation/cs/*.cs -o documentation/js -w" }
|
||||||
|
at_exit { Process.kill("INT", child) }
|
||||||
|
Signal.trap("INT") { exit }
|
||||||
loop do
|
loop do
|
||||||
mtime = File.stat(source).mtime
|
mtime = File.stat(source).mtime
|
||||||
if !@mtime || mtime > @mtime
|
if !@mtime || mtime > @mtime
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ Usage:
|
|||||||
sleep WATCH_INTERVAL
|
sleep WATCH_INTERVAL
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Signal.trap("INT") { watch_thread.kill }
|
||||||
watch_thread.join
|
watch_thread.join
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user