diff --git a/.changeset/lemon-cooks-repeat.md b/.changeset/lemon-cooks-repeat.md new file mode 100644 index 0000000..b41e113 --- /dev/null +++ b/.changeset/lemon-cooks-repeat.md @@ -0,0 +1,5 @@ +--- +"plop": patch +--- + +Adds --no-progress flag that disables the progress bar diff --git a/packages/plop/src/console-out.js b/packages/plop/src/console-out.js index 5c8bcda..7999df6 100644 --- a/packages/plop/src/console-out.js +++ b/packages/plop/src/console-out.js @@ -78,6 +78,7 @@ function displayHelpScreen() { chalk.dim( " --dest Output to this directory instead of the plopfile's parent directory", ), + chalk.dim(" --no-progress Disable the progress bar"), "", chalk.bold("Examples:"), " $ " + chalk.blue("plop"), diff --git a/packages/plop/src/plop.js b/packages/plop/src/plop.js index edf5207..251c75e 100644 --- a/packages/plop/src/plop.js +++ b/packages/plop/src/plop.js @@ -26,7 +26,7 @@ const isInJest = process.env.NODE_ENV === "test"; const progressSpinner = ora({ // Default is stderr stream: isInJest ? process.stdout : process.stderr, - isEnabled: !isInJest, + isEnabled: !isInJest && argv.progress !== false, }); /** diff --git a/packages/plop/tests/__snapshots__/input-processing.spec.js.snap b/packages/plop/tests/__snapshots__/input-processing.spec.js.snap index 07e43c3..4342dda 100644 --- a/packages/plop/tests/__snapshots__/input-processing.spec.js.snap +++ b/packages/plop/tests/__snapshots__/input-processing.spec.js.snap @@ -21,6 +21,7 @@ Options: --cwd Directory from which relative paths are calculated against while locating the plopfile --preload String or array of modules to require before running plop --dest Output to this directory instead of the plopfile's parent directory + --no-progress Disable the progress bar Examples: $ plop