mirror of
https://github.com/zebrajr/react.git
synced 2025-12-07 00:20:28 +01:00
Makes running the script a little more ergonomic by prompting for OTP upfront. ghstack-source-id: e9967bfde1ab01ff9417a848154743ae1926318d Pull Request resolved: https://github.com/facebook/react/pull/29149
19 lines
354 B
JavaScript
19 lines
354 B
JavaScript
#!/usr/bin/env node
|
|
|
|
const prompt = require("prompt-promise");
|
|
|
|
const run = async () => {
|
|
while (true) {
|
|
const otp = await prompt("NPM 2-factor auth code: ");
|
|
prompt.done();
|
|
if (otp) {
|
|
return otp;
|
|
} else {
|
|
console.error("\nTwo-factor auth is required to publish.");
|
|
// (Ask again.)
|
|
}
|
|
}
|
|
};
|
|
|
|
module.exports = run;
|