Skip to content

Commit

Permalink
Fixes sass#207 - Handle CLI errors, and exit with code 1 if there are…
Browse files Browse the repository at this point in the history
… errors
  • Loading branch information
arian committed Jan 5, 2014
1 parent 10018d9 commit dd7f509
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 dd7f509

Please sign in to comment.