aboutsummaryrefslogtreecommitdiffstats
path: root/packages/monorepo-scripts/src/publish.ts
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-07-24 03:20:09 +0800
committerFabio Berger <me@fabioberger.com>2018-07-24 03:20:09 +0800
commitb4cd8897b293e903ad5710d90d9904e1bc56c08e (patch)
treeea2b2de78c76e5b08731f148cb328b0391e6a3ff /packages/monorepo-scripts/src/publish.ts
parentdf341717f78e8100802b110b1254181cc670ecc3 (diff)
downloaddexon-0x-contracts-b4cd8897b293e903ad5710d90d9904e1bc56c08e.tar.gz
dexon-0x-contracts-b4cd8897b293e903ad5710d90d9904e1bc56c08e.tar.zst
dexon-0x-contracts-b4cd8897b293e903ad5710d90d9904e1bc56c08e.zip
Dedup versionPrompt being triggered multiple times
Diffstat (limited to 'packages/monorepo-scripts/src/publish.ts')
-rw-r--r--packages/monorepo-scripts/src/publish.ts10
1 files changed, 8 insertions, 2 deletions
diff --git a/packages/monorepo-scripts/src/publish.ts b/packages/monorepo-scripts/src/publish.ts
index 4d5425ac6..4506595e1 100644
--- a/packages/monorepo-scripts/src/publish.ts
+++ b/packages/monorepo-scripts/src/publish.ts
@@ -196,11 +196,16 @@ async function lernaPublishAsync(packageToNextVersion: { [name: string]: string
const isVersionPrompt = _.includes(output, 'Select a new version');
if (isVersionPrompt) {
const outputStripLeft = output.split('new version for ')[1];
- packageName = outputStripLeft.split(' ')[0];
+ const packageNameFound = outputStripLeft.split(' ')[0];
+ if (packageName === packageNameFound) {
+ return; // noop
+ }
+ packageName = packageNameFound;
sleepAndWrite(child.stdin, SemVerIndex.Custom);
}
const isCustomVersionPrompt = output === '? Enter a custom version ';
if (isCustomVersionPrompt) {
+ console.log('custom version prompt hit!');
const versionChange = packageToNextVersion[packageName];
if (_.isUndefined(versionChange)) {
throw new Error(`Must have a nextVersion for each packageName. Didn't find one for ${packageName}`);
@@ -225,8 +230,9 @@ async function lernaPublishAsync(packageToNextVersion: { [name: string]: string
}
function sleepAndWrite(fileDescriptor: any, input: string | number): void {
- const TIMEOUT = 100;
+ const TIMEOUT = 1000;
setTimeout(() => {
+ console.log('Printing to console:', input);
fileDescriptor.write(`${input}\n`);
}, TIMEOUT);
}