From 030d83bab402723cbcb28d48889b9bd83ee3914a Mon Sep 17 00:00:00 2001 From: Lauren Tan Date: Tue, 6 Aug 2024 15:30:47 -0400 Subject: [PATCH] [ci] Fix dist-tag command ghstack-source-id: bdbcc12b2815d00d790397c6a6702c7f6e1564e0 Pull Request resolved: https://github.com/facebook/react/pull/30619 --- compiler/scripts/release/publish.js | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/compiler/scripts/release/publish.js b/compiler/scripts/release/publish.js index 4d33474e05..1b0b7377b2 100755 --- a/compiler/scripts/release/publish.js +++ b/compiler/scripts/release/publish.js @@ -180,22 +180,17 @@ async function main() { spinner.start('Pushing tags to npm'); for (const tag of argv.tags) { try { - let opts; + let opts = ['dist-tag', 'add', `${pkgName}@${newVersion}`, tag]; if (otp != null) { - opts = [ - 'dist-tag', - 'add', - `${pkgName}@${newVersion}`, - tag, - `--otp=${otp}`, - ]; - } else { - opts = ['dist-tag', 'add', `${pkgName}@${newVersion}`, tag]; + opts.push(`--otp=${otp}`); } if (argv.debug === true) { spinner.info(`dry-run: npm ${opts.join(' ')}`); } else { - await spawnHelper('npm', opts); + await spawnHelper('npm', opts, { + cwd: pkgDir, + stdio: 'inherit', + }); } } catch (e) { spinner.fail(e.toString());