Skip to content

Commit 3bf5518

Browse files
committed
add login call
1 parent cd6c82e commit 3bf5518

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/publish.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,15 @@ export async function publish(args) {
6969
const env = {
7070
...process.env,
7171
NPM_TOKEN: args.accessToken || undefined,
72+
NPM_CONFIG_REGISTRY: args.registry || 'https://registry.npmjs.org/'
7273
}
7374

75+
// login
76+
execSync(`npm login`, {
77+
cwd: packageDirectory,
78+
env: env
79+
});
80+
7481
let packageVersionPublished = null;
7582
try {
7683
const cmd = `npm view ${packageJson.name}@${packageJson.version} version`;

0 commit comments

Comments
 (0)