add quiet option to CLI - fixes #1931
This commit is contained in:
@@ -28,7 +28,7 @@ module.exports = function (commander, filenames) {
|
||||
|
||||
outputFileSync(dest, data.code);
|
||||
|
||||
console.log(src + " -> " + dest);
|
||||
util.log(src + " -> " + dest);
|
||||
};
|
||||
|
||||
var handleFile = function (src, filename) {
|
||||
|
||||
@@ -135,7 +135,7 @@ module.exports = function (commander, filenames, opts) {
|
||||
ignoreInitial: true
|
||||
}).on("all", function (type, filename) {
|
||||
if (type === "add" || type === "change") {
|
||||
console.log(type, filename);
|
||||
util.log(type + " " + filename);
|
||||
try {
|
||||
walk();
|
||||
} catch (err) {
|
||||
|
||||
@@ -45,6 +45,7 @@ commander.option("-w, --watch", "Recompile files on changes");
|
||||
commander.option("-o, --out-file [out]", "Compile all input files into a single file");
|
||||
commander.option("-d, --out-dir [out]", "Compile an input directory of modules into an output directory");
|
||||
commander.option("-D, --copy-files", "When compiling a directory copy over non-compilable files");
|
||||
commander.option("-q, --quiet", "Don't log anything");
|
||||
|
||||
commander.on("--help", function () {
|
||||
var outKeys = function (title, obj) {
|
||||
|
||||
@@ -25,6 +25,10 @@ exports.addSourceMappingUrl = function (code, loc) {
|
||||
return code + "\n//# sourceMappingURL=" + path.basename(loc);
|
||||
};
|
||||
|
||||
exports.log = function (msg) {
|
||||
if (!commander.quiet) console.log(msg);
|
||||
};
|
||||
|
||||
exports.transform = function (filename, code, opts) {
|
||||
opts = _.defaults(opts || {}, index.opts);
|
||||
opts.filename = filename;
|
||||
|
||||
Reference in New Issue
Block a user