mirror of
https://github.com/zhigang1992/replace-in-file.git
synced 2026-04-28 20:55:31 +08:00
Tweak to CLI logging
This commit is contained in:
@@ -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'));
|
||||
|
||||
Reference in New Issue
Block a user