patrickhulce / hulk

Collection of useful scripts.
MIT License
1 stars 3 forks source link

OTP token step for npm hangs lerna publish #9

Closed connorjclark closed 1 month ago

connorjclark commented 1 year ago

Seems like it just can't read any input via the exec method used in the lerna publish step. I get the "OTP:" prompt, but nothing happens on input. Perhaps @patrickhulce you've been authenticating with a method that remembers credentials for more than a single invocation, which would skip this OTP prompt? I wasn't able to find such a method.

patrickhulce commented 1 year ago

Indeed, I don't believe I have 2FA enabled for publish of any packages I used this for since I wanted them to happen automatically.

I assume you're running into this with LHCI? Happy to accept an improvement to support OTP :)

connorjclark commented 1 year ago

Yup, LHCI. I think this would suffice: child_proc.exec(command, { env: process.env, stdio: [process.stdin, 'pipe', 'pipe'] }). I did the command manually this time, but will try the above fix next time.