Skip to content

Commit

Permalink
Add --no-spinner option
Browse files Browse the repository at this point in the history
  • Loading branch information
joebowbeer authored and pahen committed Oct 31, 2018
1 parent c5f4daa commit b1ad3eb
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions bin/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ program
.option('--webpack-config <file>', 'path to webpack config')
.option('--include-npm', 'include shallow NPM modules', false)
.option('--no-color', 'disable color in output and image', false)
.option('--no-spinner', 'disable progress spinner', false)
.option('--stdin', 'read predefined tree from STDIN', false)
.option('--warning', 'show warnings about skipped files', false)
.option('--debug', 'turn on debug output', false)
Expand Down Expand Up @@ -62,7 +63,8 @@ program.options.forEach((opt) => {
const spinner = ora({
text: 'Finding files',
color: 'white',
interval: 100000
interval: 100000,
isEnabled: program.spinner
});

let exitCode = 0;
Expand Down Expand Up @@ -116,8 +118,10 @@ function dependencyFilter() {
const dir = path.dirname(relPath) + '/';
const file = path.basename(relPath);

spinner.text = chalk.grey(dir) + chalk.cyan(file);
spinner.render();
if (program.spinner) {
spinner.text = chalk.grey(dir) + chalk.cyan(file);
spinner.render();
}
prevFile = traversedFilePath;
}
};
Expand Down

0 comments on commit b1ad3eb

Please sign in to comment.