node.js - How can I login to yarn non-interactively? -


when using npm, can login non-interactively with:

$ printf "jesstelford\n<password>\nexample@email.com\n" | npm login 

however, similar command yarn hangs:

$ printf "jesstelford\nexample@email.com\n" | yarn login yarn login v0.21.3 question npm username: jesstelford question npm email: 

in interactive mode, can run:

$ yarn login yarn login v0.21.3 question npm username: jesstelford question npm email: example@email.com ✨  done in 22.53s. 

how can run yarn login non-interactively?

yarn appears pause after username entered. need pause when in non-interactive mode:

$ { echo "jesstelford"; sleep 1; echo "example@email.com"; } | yarn login 

this give following output:

yarn login v0.21.3 question npm username: jesstelford question npm email: example@email.com ✨  done in 0.84s. 

how works

echo "jesstelford" enters string, followed newline character

sleep 1 insert 1 second pause after entering username, before continuing on enter email:

echo "example@email.com" enters second string, followed newline character end command.


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -