From a68ca2146940a82dae45348585d1a87aa27ed1ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20O=E2=80=99Shannessy?= Date: Thu, 21 Jul 2016 15:57:12 -0700 Subject: [PATCH] [rrm] Add logging to execInRepo, dry-run option --- scripts/release-manager/cli.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/release-manager/cli.js b/scripts/release-manager/cli.js index 04207325a4..b7f5790db8 100755 --- a/scripts/release-manager/cli.js +++ b/scripts/release-manager/cli.js @@ -19,6 +19,9 @@ const vorpal = new Vorpal(); // TODO: Make this an argument to the script const PATH_TO_REPO = path.resolve('../../../react'); +// Quick dry run opt-in. This allows quick debugging of execInRepo without +// actually running the command, ensuring no accidental publishing. +const DRY_RUN = false; // HELPERS @@ -33,6 +36,12 @@ function writeTo(file, data) { // Wrapper around exec so we don't have to worry about paths function execInRepo(command) { + vorpal.log(chalk.gray(`Executing ${chalk.underline(command)}`)); + + if (DRY_RUN) { + return ''; + } + return execSync(command, { cwd: PATH_TO_REPO, encoding: 'utf8',