Skip to content

Commit 638978b

Browse files
committed
feat: ✨ add --no-npm option
This makes the npm setup optional when using the --no-npm option on setup. Fixes Feature request: Make npm configuration optional semantic-release#318
1 parent 0421ca5 commit 638978b

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/index.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ const knownOptions = {
2121
version: Boolean,
2222
help: Boolean,
2323
keychain: Boolean,
24+
npm: Boolean,
2425
'ask-for-passwords': Boolean,
2526
'gh-token': String,
2627
'npm-token': String,
@@ -63,6 +64,7 @@ Options:
6364
--npm-token=<String> npm auth token
6465
--circle-token=<String> CircleCI auth token
6566
--npm-username=<String> npm username
67+
--no-npm Do not setup npm.
6668
6769
Aliases:
6870
init setup`);
@@ -84,7 +86,9 @@ Aliases:
8486

8587
try {
8688
await require('./lib/repository')(pkg, info);
87-
await require('./lib/npm')(pkg, info);
89+
if (info.options.npm) {
90+
await require('./lib/npm')(pkg, info);
91+
}
8892
await require('./lib/github')(info);
8993
await require('./lib/ci')(pkg, info);
9094
} catch (error) {

src/lib/ci.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const cis = {
1717
const message = `
1818
${_.repeat('-', 46)}
1919
GH_TOKEN=${info.github.token}
20-
NPM_TOKEN=${info.npm.token}
20+
${info.options.npm ? "NPM_TOKEN=" + info.npm.token : ""}
2121
${_.repeat('-', 46)}
2222
`;
2323
console.log(message);

0 commit comments

Comments
 (0)