Skip to content
This repository was archived by the owner on May 29, 2026. It is now read-only.

Commit e027aee

Browse files
committed
fix: improve error handling in npm-publish script for 2FA code prompt
1 parent c26d063 commit e027aee

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

scripts/npm-publish.mjs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ for (const d of ["core", "api", "runtime", "cli"]) {
1010
cd(`packages/${d}`);
1111
const res =
1212
await $`pnpm publish --access public --otp ${otp} --publish-branch dev --no-git-checks`.nothrow();
13-
if (res.exitCode !== 0) otp = await question("Please enter your npm 2FA code: ");
14-
await $`pnpm publish --access public --otp ${otp} --publish-branch dev --no-git-checks`;
13+
if (res.exitCode !== 0) {
14+
otp = await question("Please enter your npm 2FA code: ");
15+
await $`pnpm publish --access public --otp ${otp} --publish-branch dev --no-git-checks`;
16+
}
1517
cd(cwd);
1618
}

0 commit comments

Comments
 (0)