diff --git a/Rakefile b/Rakefile index 497d07e8..87c11bee 100644 --- a/Rakefile +++ b/Rakefile @@ -18,7 +18,9 @@ end desc "Build the documentation page" task :doc do 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 mtime = File.stat(source).mtime if !@mtime || mtime > @mtime diff --git a/lib/coffee_script/command_line.rb b/lib/coffee_script/command_line.rb index 105292dd..2c313bdf 100644 --- a/lib/coffee_script/command_line.rb +++ b/lib/coffee_script/command_line.rb @@ -65,6 +65,7 @@ Usage: sleep WATCH_INTERVAL end end + Signal.trap("INT") { watch_thread.kill } watch_thread.join end