Skip to content

Commit

Permalink
adapt npm login for [email protected]
Browse files Browse the repository at this point in the history
  • Loading branch information
louis-bompart committed Nov 10, 2022
1 parent 32aa8e7 commit c159279
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions packages/cli-e2e/utils/npmLogin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@ import {EOL} from 'os';
import {answerPrompt} from './cli';
import {Terminal} from './terminal/terminal';
import {npm} from './npm';

// https://docs.npmjs.com/cli/v9/commands/npm-adduser
export const npmLogin = async () => {
const args = [...npm(), 'login', '--registry=http://localhost:4873'];
const args = [
...npm(),
'login',
'--registry=http://localhost:4873',
'--auth-type=legacy',
];
const npmLogin = new Terminal(args.shift()!, args);

npmLogin.orchestrator.process.stdout.pipe(process.stdout);
Expand All @@ -25,10 +30,10 @@ export const npmLogin = async () => {
.when(/Email:/)
.on('stdout')
.do(answerPrompt(`[email protected]${EOL}`))
.until(/Logged in as/);
.until(/Logged in on/);

await npmLogin
.when(/Logged in as/)
.when(/Logged in on/)
.on('stdout')
.do()
.once();
Expand Down

0 comments on commit c159279

Please sign in to comment.