mirror of
https://github.com/zebrajr/react.git
synced 2025-12-06 12:20:20 +01:00
25 lines
545 B
JavaScript
25 lines
545 B
JavaScript
#!/usr/bin/env node
|
|
/**
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
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;
|