MCPcopy Create free account
hub / github.com/angular/dev-infra / startInteractiveLogin

Function startInteractiveLogin

ng-dev/release/versioning/npm-command.ts:145–156  ·  view source on GitHub ↗

* Log into NPM at a provided registry using an interactive invocation. * @throws With the `npm login` status code if the login failed.

(registryUrl: string | undefined)

Source from the content-addressed store, hash-verified

143 }
144
145 /**
146 * Checks whether the user is currently logged into NPM.
147 * @returns Whether the user is currently logged into NPM.
148 */
149 static async checkIsLoggedIn(registryUrl: string | undefined): Promise<boolean> {
150 const args = ['whoami'];
151 // If a custom registry URL has been specified, add the `--registry` flag.
152 if (registryUrl !== undefined) {
153 args.push('--registry', registryUrl);
154 }
155 try {
156 await ChildProcess.spawn('npm', args, {mode: 'silent'});
157 } catch (e) {
158 return false;
159 }

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected