Skip to content

Commit

Permalink
Add check to release script to run only within npm
Browse files Browse the repository at this point in the history
  • Loading branch information
chandlerprall committed Jun 25, 2018
1 parent 5aa4909 commit 31d5a5a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions scripts/release.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ const humanReadableTypes = {
};

(async function () {
// make sure the release script is being run by npm (required for `npm publish` step)
// https://github.com/yarnpkg/yarn/issues/5063
const packageManagerScript = path.basename(process.env.npm_execpath);
if (packageManagerScript !== 'npm-cli.js') {
console.error('The release script must be run with npm: npm run release');
process.exit(1);
}

// ensure git is on the master branch
await ensureMasterBranch();

Expand Down

0 comments on commit 31d5a5a

Please sign in to comment.