Skip to content

Commit

Permalink
[added] support for private option
Browse files Browse the repository at this point in the history
- when the package.json is private, the release will skip npm and bower
  • Loading branch information
dozoisch committed Aug 8, 2015
1 parent 2c1ab45 commit 7a83edd
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/release.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const packagePath = path.join(repoRoot, 'package.json');
const changelog = path.join(repoRoot, 'CHANGELOG.md');

const npmjson = JSON.parse(cat(packagePath));
const isPrivate = npmjson.private;

//------------------------------------------------------------------------------
// check if one of 'rf-changelog' or 'mt-changelog' is used by project
Expand Down Expand Up @@ -195,12 +196,18 @@ function release({ type, preid }) {
console.log('Tagged: '.cyan + vVersion.green);

// npm
console.log('Releasing: '.cyan + 'npm package'.green);
safeRun('npm publish');
console.log('Released: '.cyan + 'npm package'.green);
if (isPrivate) {
console.log('Package is private, skipping npm release'.yellow);
} else {
console.log('Releasing: '.cyan + 'npm package'.green);
safeRun('npm publish');
console.log('Released: '.cyan + 'npm package'.green);
}

// bower
if (bowerRepo) {
if (isPrivate) {
console.log('Package is private, skipping bower release'.yellow);
} else if (bowerRepo) {
console.log('Releasing: '.cyan + 'bower package'.green);
rm('-rf', tmpBowerRepo);
run(`git clone ${bowerRepo} ${tmpBowerRepo}`);
Expand Down

0 comments on commit 7a83edd

Please sign in to comment.