Skip to content

Commit

Permalink
Not exiting process for first error when watching
Browse files Browse the repository at this point in the history
  • Loading branch information
curvedmark committed Oct 6, 2013
1 parent e8acdc2 commit 8b1fb99
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions bin/roole
Expand Up @@ -106,7 +106,11 @@ function compileFileTo(filename, outname) {
roole.compile(data, opts, function (err, css) {
if (err) {
displayError(err);
if (program.watch) return;
if (program.watch) {
var imports = Object.keys(opts.imports);
watchFile(filename, imports, outname);
return;
}
process.exit(1);
}

Expand All @@ -117,11 +121,14 @@ function compileFileTo(filename, outname) {

if (!css && !program.force) {
filename = path.relative(cwd, filename);
var msg = program.watch
? ' %s compiled to empty string, not writing to file'
: 'INFO: %s compiled to empty string, not writing to file';

console.log(msg, filename);
if (program.watch) {
console.log(' %s compiled to empty string, not writing to file', filename);
var imports = Object.keys(opts.imports);
watchFile(filename, imports, outname);
return;
}

console.log('INFO: %s compiled to empty string, not writing to file', filename);
return;
}

Expand Down

0 comments on commit 8b1fb99

Please sign in to comment.