Tweak to CLI logging

This commit is contained in:
Adam Reis
2017-03-07 16:09:21 +13:00
parent 61a4c54214
commit defdeaa52a

View File

@@ -100,9 +100,11 @@ if (typeof argv.allowEmptyPaths !== 'undefined') {
//Replace
try {
const changedFiles = replace.sync(options);
console.log(chalk.green(changedFiles.length, 'file(s) were changed'));
if (argv.verbose && (changedFiles.length > 0)) {
changedFiles.forEach(file => console.log(chalk.grey('-', file)));
if (changedFiles.length > 0) {
console.log(chalk.green(changedFiles.length, 'file(s) were changed'));
if (argv.verbose) {
changedFiles.forEach(file => console.log(chalk.grey('-', file)));
}
}
else {
console.log(chalk.yellow('No files were changed'));