Permalink
Browse files

better error printing in the command line tool

  • Loading branch information...
1 parent 8068f7c commit 38c69cc815328dad012071e4773be9ce5f13bd2f @malgorithms committed Aug 16, 2012
Showing with 17 additions and 6 deletions.
  1. +9 −3 lib/command_line.js
  2. +1 −1 package.json
  3. +7 −2 src/command_line.coffee
View
Oops, something went wrong.
View
@@ -1,7 +1,7 @@
{
"name": "toffee",
"description": "An Express 3.x and 2.x templating language based on CoffeeScript with slicker tokens and syntax. Built with love at OkCupid.",
- "version": "0.0.37",
+ "version": "0.0.38",
"directories": {
"lib": "./lib"
},
@@ -47,12 +47,17 @@ compile = (start_path, path) ->
and path is /foo/bar/car/thing.toffee
###
source = fs.readFileSync path, 'utf8'
+ bundle_path = path[start_path.length...]
v = new view source,
fileName: path
- bundlePath: path[start_path.length...]
+ bundlePath: bundle_path
browserMode: true
minimize: program.minimize? and program.minimize
- return v._toJavaScript()
+ js = v._toJavaScript()
+ if v.error
+ process.stderr.write v.error.getPrettyPrintText()
+ process.exit 1
+ js
# -----------------------------------------------------------------------------

0 comments on commit 38c69cc

Please sign in to comment.