react/compiler/scripts/release/prompt-for-otp.js
Lauren Tan b195a947de [compiler:publish] Prompt for OTP
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
2024-05-17 15:07:04 -07:00

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;