Skip to content

Commit acf4525

Browse files
committed
Add $npm_config_shell fallback in version script
Due to [RFC 21], in npm@^7 default configs are no longer included in the script environment. Therefore, if shell is not explicitly configured, `$npm_config_shell` will be unset. Handle this by falling back to $SHELL (the shell from which npm was invoked), or to bash if both are unset. [RFC 21]: https://github.com/npm/rfcs/blob/latest/implemented/0021-reduce-lifecycle-script-environment.md Signed-off-by: Kevin Locke <[email protected]>
1 parent 27b6f44 commit acf4525

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"//": "Note: nyc incompatible with --parallel. See https://github.com/istanbuljs/nyc/issues/1328 and https://github.com/mochajs/mocha/issues/4372",
4949
"test-unit-cov": "nyc --reporter=lcov --reporter=text node --throw-deprecation --unhandled-rejections=strict node_modules/mocha/bin/mocha --recursive test",
5050
"upload-cov": "codecov < ./coverage/lcov.info && coveralls < ./coverage/lcov.info",
51-
"version": "npm run changelog && echo && echo === Please edit CHANGELOG.md as desired, then exit === && echo && $npm_config_shell && git commit -m \"Update CHANGELOG.md for $npm_package_version\" CHANGELOG.md",
51+
"version": "npm run changelog && echo && echo === Please edit CHANGELOG.md as desired, then exit === && echo && \"${npm_config_shell-:${SHELL-:bash}}\" && git commit -m \"Update CHANGELOG.md for $npm_package_version\" CHANGELOG.md",
5252
"version-deps": "npm install conventional-changelog-cli david depcheck git-branch-is hub-ci-status"
5353
},
5454
"dependencies": {

0 commit comments

Comments
 (0)