Skip to content

Commit f95bcdd

Browse files
committed
Use new signature of addUser()
1 parent 5cd6bb3 commit f95bcdd

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

index.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ const semver = require('semver')
66

77
log.heading = 'publish';
88

9+
10+
const BASE_URL = 'https://registry.npmjs.org/'
11+
12+
913
function start(tagName, callback) {
1014
var loadOptions = {};
1115
if (tagName) {
@@ -20,7 +24,7 @@ function start(tagName, callback) {
2024

2125
function localPackage(callback) {
2226
try {
23-
var json = require(__dirname+'/package.json');
27+
var json = require(process.cwd()+'/package.json');
2428
} catch (err) {
2529
return callback(err);
2630
}
@@ -111,11 +115,11 @@ function isCI() {
111115
return process.env.CI;
112116
}
113117

114-
function npmAddUser(npmUser, callback) {
115-
npm.registry.adduser(npmUser.username, npmUser.password, npmUser.email, function(err) {
116-
npm.config.set("email", npmUser.email, "user");
117-
callback(err);
118-
});
118+
function npmAddUser(auth, callback) {
119+
npm.registry.adduser(BASE_URL, {auth}, function(err) {
120+
npm.config.set("email", auth.email, "user");
121+
callback(err);
122+
});
119123
}
120124

121125
function shouldPublish(options, localVersion, remoteVersion) {

0 commit comments

Comments
 (0)