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

Respect quiet option in Node API #2344

Merged
merged 1 commit into from
Apr 24, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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