Skip to content

Commit ec98e77

Browse files
authored
npm: Ask for a one-time password for npm dist-tag add as well
Closes gh-105
1 parent 00c8feb commit ec98e77

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/npm.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,13 @@ module.exports = function( Release ) {
9898
Release.exec( npmPublish );
9999

100100
while ( npmTags.length ) {
101-
npmPublish = "npm dist-tag add " + newVersion + " " + npmTags.pop();
101+
102+
// Ask for OTP before adding each tag as the code may get invalid
103+
// if the process takes too long.
104+
otp = await Release._getNpmOtp();
105+
npmPublish = `npm dist-tag add ${ newVersion } ${ npmTags.pop() } ${
106+
otp ? `--otp ${ otp }` : ""
107+
}`;
102108
console.log( " " + chalk.cyan( npmPublish ) );
103109
if ( !Release.isTest ) {
104110
Release.exec( npmPublish );

0 commit comments

Comments
 (0)