Skip to content

Commit 2dbe912

Browse files
committed
feat: add check npm whoami
1 parent c18da1e commit 2dbe912

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/options.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import {
2222
import { logger } from './logger';
2323
import { getPackageManagerConfig } from './manager';
2424
import { getNpmInfo, getNpmRegistry } from './npm';
25-
import { createSpin, isScopedPackage, joinArray, setOptions } from './utils';
25+
import { createSpin, isScopedPackage, joinArray, run, setOptions } from './utils';
2626
import {
2727
diffColor,
2828
getPreReleaseId,
@@ -56,6 +56,10 @@ export async function getReleaseOptions(options: ReleaseCLIOptions) {
5656
const spin = createSpin(`Get npm info from npm registry`);
5757
const list = await Promise.all(opts.pkgs.map(pkg => getNpmInfo(pkg)));
5858
spin.stop();
59+
60+
// check npm login
61+
await run(`npm whoami --registry=${opts.pkgs[0].registry || NPM_REGISTRY}`);
62+
5963
list.forEach((s, i) => {
6064
opts.pkgs[i].npmInfo = s;
6165
});

0 commit comments

Comments
 (0)