improving errors for undefined options, and error messages for compile attempts on nonexistent files

This commit is contained in:
Jeremy Ashkenas
2010-02-25 18:36:43 -05:00
parent 213ae1430e
commit c62f93f930
4 changed files with 14 additions and 9 deletions

View File

@@ -63,7 +63,9 @@ version: ->
# or JSLint results.
compile_scripts: ->
compile: (source) ->
fs.readFile source, (err, code) -> compile_script(source, code)
path.exists source, (exists) ->
throw new Error 'File not found: ' + source unless exists
fs.readFile source, (err, code) -> compile_script(source, code)
compile(source) for source in sources
# Compile a single source script, containing the given code, according to the