Skip to content

Commit

Permalink
Move changedFiles logging outside of if (#17)
Browse files Browse the repository at this point in the history
When the changed file was not found, there was no information from the cli which would let me know this. Because of that, an incorrect file path would be silently responded to with `"Replacing from with to"`.
  • Loading branch information
dawsbot authored and adamreisnz committed Mar 7, 2017
1 parent 3a3ca2c commit f99a273
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions bin/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,8 @@ if (typeof argv.allowEmptyPaths !== 'undefined') {
//Replace
try {
const changedFiles = replace.sync(options);
if (changedFiles.length > 0) {
console.log(chalk.green(changedFiles.length, 'file(s) were changed'));
if (argv.verbose) {
console.log(chalk.green(changedFiles.length, 'file(s) were changed'));
if (argv.verbose && (changedFiles.length > 0)) {
changedFiles.forEach(file => console.log(chalk.grey('-', file)));
}
}
Expand Down

0 comments on commit f99a273

Please sign in to comment.