Skip to content

Commit

Permalink
chore(release): fix release script (#2946)
Browse files Browse the repository at this point in the history
NPM doesn't seem to responde to `npm owner add`, this implements
an alternative way to check if the currently logged NPM user is in
the list of contributors on NPM.
  • Loading branch information
bobylito authored May 28, 2018
1 parent 95279d7 commit 70e53d1
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions scripts/release.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@ const {
} = require('./conventionalChangelog.js');

// check if user can publish new version to npm
const { code: isNotOwner } = shell.exec('$(npm owner add `npm whoami`)', {
silent: true,
});
const ownersFound = parseFloat(
shell.exec('npm owner ls | grep "`npm whoami` " | wc -l', {
silent: true,
})
);

if (isNotOwner) {
if (ownersFound !== 1) {
shell.echo(
colors.red(`
You are not an owner of the npm repository,
Expand Down

0 comments on commit 70e53d1

Please sign in to comment.