Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Commit

Permalink
Merge pull request #209 from arian/fix-207-cli-errorcode
Browse files Browse the repository at this point in the history
Fixes #207 - Handle CLI errors, and exit with code 1 if there are errors
  • Loading branch information
andrew committed Jan 5, 2014
2 parents 10018d9 + dd7f509 commit 09ccd48
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion lib/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@ exports = module.exports = function(args) {

var emitter = new Emitter();

emitter.on('error', function(){});
emitter.on('error', function(err){
console.error(err);
process.exit(1);
});

var options = {
stdout: argv.stdout
Expand Down
2 changes: 1 addition & 1 deletion lib/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function render(options, emitter) {
emitter.emit('render', css);
},
error: function(error) {
emitter.emit('error', error);
emitter.emit('error', chalk.red(error));
}
});
}
Expand Down

0 comments on commit 09ccd48

Please sign in to comment.