From 88ee35d5f9a3d5497c6ffcf5f751be40cbaf7a00 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Thu, 26 Jul 2018 12:14:13 +0200 Subject: Call 'lerna publish' with spawn so we see stderr and stdout in real-time --- packages/monorepo-scripts/src/publish.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'packages') diff --git a/packages/monorepo-scripts/src/publish.ts b/packages/monorepo-scripts/src/publish.ts index 5992131db..8f140fc5a 100644 --- a/packages/monorepo-scripts/src/publish.ts +++ b/packages/monorepo-scripts/src/publish.ts @@ -4,7 +4,7 @@ import * as promisify from 'es6-promisify'; import * as _ from 'lodash'; import * as moment from 'moment'; import opn = require('opn'); -import { exec as execAsync } from 'promisify-child-process'; +import { exec as execAsync, spawn as spawnAsync } from 'promisify-child-process'; import * as prompt from 'prompt'; import semver = require('semver'); import semverSort = require('semver-sort'); @@ -189,7 +189,15 @@ async function lernaPublishAsync(packageToNextVersion: { [name: string]: string lernaPublishCmd += ` --skip-git`; } utils.log('Lerna is publishing...'); - await execAsync(lernaPublishCmd, { cwd: constants.monorepoRootPath }); + const child = await spawnAsync(lernaPublishCmd, { cwd: constants.monorepoRootPath }); + child.stdout.on('data', (data: Buffer) => { + const output = data.toString('utf8'); + utils.log('Stdout: ', output); + }); + child.stderr.on('data', (data: Buffer) => { + const output = data.toString('utf8'); + utils.log('Stderr: ', output); + }); } function updateVersionNumberIfNeeded(currentVersion: string, proposedNextVersion: string): string { -- cgit v1.2.3