Skip to content

Commit 7a83edd

Browse files
committed
[added] support for private option
- when the package.json is private, the release will skip npm and bower
1 parent 2c1ab45 commit 7a83edd

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

src/release.js

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ const packagePath = path.join(repoRoot, 'package.json');
1717
const changelog = path.join(repoRoot, 'CHANGELOG.md');
1818

1919
const npmjson = JSON.parse(cat(packagePath));
20+
const isPrivate = npmjson.private;
2021

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

197198
// npm
198-
console.log('Releasing: '.cyan + 'npm package'.green);
199-
safeRun('npm publish');
200-
console.log('Released: '.cyan + 'npm package'.green);
199+
if (isPrivate) {
200+
console.log('Package is private, skipping npm release'.yellow);
201+
} else {
202+
console.log('Releasing: '.cyan + 'npm package'.green);
203+
safeRun('npm publish');
204+
console.log('Released: '.cyan + 'npm package'.green);
205+
}
201206

202207
// bower
203-
if (bowerRepo) {
208+
if (isPrivate) {
209+
console.log('Package is private, skipping bower release'.yellow);
210+
} else if (bowerRepo) {
204211
console.log('Releasing: '.cyan + 'bower package'.green);
205212
rm('-rf', tmpBowerRepo);
206213
run(`git clone ${bowerRepo} ${tmpBowerRepo}`);

0 commit comments

Comments
 (0)