aboutsummaryrefslogtreecommitdiffstats
path: root/packages/monorepo-scripts
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-07-24 03:33:03 +0800
committerFabio Berger <me@fabioberger.com>2018-07-24 03:33:03 +0800
commitd50174b89eda6a9df590dac6b121885b74ec35d9 (patch)
tree2dac99ff63171c4e2c8c9710aa6c3ab31a46dbfc /packages/monorepo-scripts
parent1d9a77027eaf2ae9a21262305f75a274b0bd214a (diff)
downloaddexon-sol-tools-d50174b89eda6a9df590dac6b121885b74ec35d9.tar
dexon-sol-tools-d50174b89eda6a9df590dac6b121885b74ec35d9.tar.gz
dexon-sol-tools-d50174b89eda6a9df590dac6b121885b74ec35d9.tar.bz2
dexon-sol-tools-d50174b89eda6a9df590dac6b121885b74ec35d9.tar.lz
dexon-sol-tools-d50174b89eda6a9df590dac6b121885b74ec35d9.tar.xz
dexon-sol-tools-d50174b89eda6a9df590dac6b121885b74ec35d9.tar.zst
dexon-sol-tools-d50174b89eda6a9df590dac6b121885b74ec35d9.zip
Add ignore flag
Diffstat (limited to 'packages/monorepo-scripts')
-rw-r--r--packages/monorepo-scripts/src/publish.ts8
1 files changed, 8 insertions, 0 deletions
diff --git a/packages/monorepo-scripts/src/publish.ts b/packages/monorepo-scripts/src/publish.ts
index df1bfff2f..42d0a374f 100644
--- a/packages/monorepo-scripts/src/publish.ts
+++ b/packages/monorepo-scripts/src/publish.ts
@@ -185,7 +185,12 @@ async function lernaPublishAsync(packageToNextVersion: { [name: string]: string
});
let shouldPrintOutput = false;
let packageName: string;
+ let ignoreCounter = 0;
child.stdout.on('data', (data: Buffer) => {
+ if (ignoreCounter !== 0) {
+ ignoreCounter--;
+ return; // ignore
+ }
const output = data.toString('utf8');
console.log('-------');
console.log(output);
@@ -201,6 +206,7 @@ async function lernaPublishAsync(packageToNextVersion: { [name: string]: string
return; // noop
}
packageName = packageNameFound;
+ ignoreCounter = 1; // SemVerIndex.Custom is a single digit number
sleepAndWrite(child.stdin, SemVerIndex.Custom);
}
const isCustomVersionPrompt = _.includes(output, 'Enter a custom version');
@@ -209,10 +215,12 @@ async function lernaPublishAsync(packageToNextVersion: { [name: string]: string
if (_.isUndefined(versionChange)) {
throw new Error(`Must have a nextVersion for each packageName. Didn't find one for ${packageName}`);
}
+ ignoreCounter = versionChange.length;
sleepAndWrite(child.stdin, versionChange);
}
const isFinalPrompt = _.includes(output, 'Are you sure you want to publish the above changes?');
if (isFinalPrompt && !IS_DRY_RUN) {
+ ignoreCounter = 'y'.length;
sleepAndWrite(child.stdin, 'y');
// After confirmations, we want to print the output to watch the `lerna publish` command
shouldPrintOutput = true;