From afe07b2926b379857d6a05a3ab00768ec16ebcdc Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Mon, 2 Apr 2018 17:59:47 +0900 Subject: Should print out `lerna publish` stdout so we can see if anything went wrong --- packages/monorepo-scripts/src/publish.ts | 6 ++++++ 1 file changed, 6 insertions(+) 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.`, -- cgit