From e7e8e243a2e7955a95c92c18367158a69e6d7800 Mon Sep 17 00:00:00 2001 From: Jeremy Ashkenas Date: Fri, 25 Dec 2009 00:02:27 -0800 Subject: [PATCH] better error warnings on the command line --- lib/coffee_script/command_line.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/coffee_script/command_line.rb b/lib/coffee_script/command_line.rb index f7bf6c94..33439f85 100644 --- a/lib/coffee_script/command_line.rb +++ b/lib/coffee_script/command_line.rb @@ -105,12 +105,18 @@ Usage: # Use Narwhal to run an interactive CoffeeScript session. def launch_repl exec "narwhal lib/coffee_script/narwhal/js/launcher.js" + rescue Errno::ENOENT + puts "Error: Narwhal must be installed to use the interactive REPL." + exit(1) end # Use Narwhal to compile and execute CoffeeScripts. def run_scripts sources = @sources.join(' ') exec "narwhal lib/coffee_script/narwhal/js/launcher.js #{sources}" + rescue Errno::ENOENT + puts "Error: Narwhal must be installed in order to execute CoffeeScripts." + exit(1) end # Print the tokens that the lexer generates from a source script.