Skip to content

Commit

Permalink
version: fix sign-git-commit options (#58)
Browse files Browse the repository at this point in the history
Oops: 7984206 did the
wrong thing with the git params, and it breaks anyone
trying to sign their git commits with npm version.

Fixes: https://npm.community/t/1661
Credit: @zkat
  • Loading branch information
zkat committed Dec 10, 2018
1 parent 463070f commit 7f21841
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/version.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,11 @@ function _commit (version, localData, cb) {
const message = npm.config.get('message').replace(/%s/g, version)
const signTag = npm.config.get('sign-git-tag')
const signCommit = npm.config.get('sign-git-commit')
const commitArgs = buildCommitArgs([ 'commit', signCommit ? '-S -m' : '-m', message ])
const commitArgs = buildCommitArgs([
'commit',
...(signCommit ? ['-S', '-m'] : ['-m']),
message
])
const flagForTag = signTag ? '-sm' : '-am'

stagePackageFiles(localData, options).then(() => {
Expand Down

0 comments on commit 7f21841

Please sign in to comment.