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

Commit

Permalink
Respect quiet option in Node API
Browse files Browse the repository at this point in the history
This is an extension of #2268. Catches a few places missed the
first time around.
  • Loading branch information
xzyfer committed Apr 24, 2018
1 parent 8004d10 commit 4a858f1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions bin/node-sass
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,12 @@ function getEmitter() {
}
});

emitter.on('info', function(data) {
if (!options.quiet) {
console.info(data);
}
});

emitter.on('log', stdout.write.bind(stdout));

return emitter;
Expand Down
6 changes: 3 additions & 3 deletions lib/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ module.exports = function(options, emitter) {
return done();
}

emitter.emit('warn', chalk.green('Rendering Complete, saving .css file...'));
emitter.emit('info', chalk.green('Rendering Complete, saving .css file...'));

mkdirp(path.dirname(destination), function(err) {
if (err) {
Expand All @@ -76,7 +76,7 @@ module.exports = function(options, emitter) {
return emitter.emit('error', chalk.red(err));
}

emitter.emit('warn', chalk.green('Wrote CSS to ' + destination));
emitter.emit('info', chalk.green('Wrote CSS to ' + destination));
emitter.emit('write', err, destination, result.css.toString());
done();
});
Expand All @@ -94,7 +94,7 @@ module.exports = function(options, emitter) {
return emitter.emit('error', chalk.red('Error' + err));
}

emitter.emit('warn', chalk.green('Wrote Source Map to ' + sourceMap));
emitter.emit('info', chalk.green('Wrote Source Map to ' + sourceMap));
emitter.emit('write-source-map', err, sourceMap, result.map);
done();
});
Expand Down

0 comments on commit 4a858f1

Please sign in to comment.