aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-04-02 16:59:47 +0800
committerFabio Berger <me@fabioberger.com>2018-04-02 16:59:47 +0800
commitafe07b2926b379857d6a05a3ab00768ec16ebcdc (patch)
tree78287e128ef938fd46e5ef40d02923f206dd30fb
parent2411bfc20f86addd9e2edaa12e2899cf60967cd3 (diff)
downloaddexon-sol-tools-afe07b2926b379857d6a05a3ab00768ec16ebcdc.tar
dexon-sol-tools-afe07b2926b379857d6a05a3ab00768ec16ebcdc.tar.gz
dexon-sol-tools-afe07b2926b379857d6a05a3ab00768ec16ebcdc.tar.bz2
dexon-sol-tools-afe07b2926b379857d6a05a3ab00768ec16ebcdc.tar.lz
dexon-sol-tools-afe07b2926b379857d6a05a3ab00768ec16ebcdc.tar.xz
dexon-sol-tools-afe07b2926b379857d6a05a3ab00768ec16ebcdc.tar.zst
dexon-sol-tools-afe07b2926b379857d6a05a3ab00768ec16ebcdc.zip
Should print out `lerna publish` stdout so we can see if anything went wrong
-rw-r--r--packages/monorepo-scripts/src/publish.ts6
1 files changed, 6 insertions, 0 deletions
diff --git a/packages/monorepo-scripts/src/publish.ts b/packages/monorepo-scripts/src/publish.ts
index 240158c77..d749ec630 100644
--- a/packages/monorepo-scripts/src/publish.ts
+++ b/packages/monorepo-scripts/src/publish.ts
@@ -112,8 +112,12 @@ async function lernaPublishAsync(packageToVersionChange: { [name: string]: strin
const child = spawn('lerna', ['publish', '--registry=https://registry.npmjs.org/'], {
cwd: constants.monorepoRootPath,
});
+ let shouldPrintOutput = false;
child.stdout.on('data', (data: Buffer) => {
const output = data.toString('utf8');
+ if (shouldPrintOutput) {
+ utils.log(output);
+ }
const isVersionPrompt = _.includes(output, 'Select a new version');
if (isVersionPrompt) {
const outputStripLeft = output.split('new version for ')[1];
@@ -129,6 +133,8 @@ async function lernaPublishAsync(packageToVersionChange: { [name: string]: strin
const isFinalPrompt = _.includes(output, 'Are you sure you want to publish the above changes?');
if (isFinalPrompt && !IS_DRY_RUN) {
child.stdin.write(`y\n`);
+ // After confirmations, we want to print the output to watch the `lerna publish` command
+ shouldPrintOutput = true;
} else if (isFinalPrompt && IS_DRY_RUN) {
utils.log(
`Submitted all versions to Lerna but since this is a dry run, did not confirm. You need to CTRL-C to exit.`,