[ci] Fix dist-tag command
ghstack-source-id: bdbcc12b2815d00d790397c6a6702c7f6e1564e0 Pull Request resolved: https://github.com/facebook/react/pull/30619
Lauren Tan committed
Aug 6, 2024 at 15:30 UTC
030d83bab402723cbcb28d48889b9bd83ee3914a
1 file changed
+6
-11
compiler/scripts/release/publish.js
+6
-11
@@ -180,22 +180,17 @@ async function main() {
180
spinner.start('Pushing tags to npm');
181
for (const tag of argv.tags) {
182
try {
183
- let opts;
183
+ let opts = ['dist-tag', 'add', `${pkgName}@${newVersion}`, tag];
184
if (otp != null) {
185
- opts = [
186
- 'dist-tag',
187
- 'add',
188
- `${pkgName}@${newVersion}`,
189
- tag,
190
- `--otp=${otp}`,
191
- ];
192
- } else {
193
- opts = ['dist-tag', 'add', `${pkgName}@${newVersion}`, tag];
185
+ opts.push(`--otp=${otp}`);
186
}
187
if (argv.debug === true) {
188
spinner.info(`dry-run: npm ${opts.join(' ')}`);
189
} else {
198
- await spawnHelper('npm', opts);
190
+ await spawnHelper('npm', opts, {
191
+ cwd: pkgDir,
192
+ stdio: 'inherit',
193
+ });
194
}
195
} catch (e) {
196
spinner.fail(e.toString());