From 89652cb9b810f929f5586fc90cc6794d076603fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kat=20March=C3=A1n?= Date: Wed, 29 Aug 2018 11:42:37 -0700 Subject: [PATCH] version: fix sign-git-commit options (#58) Oops: 7984206e2f41b8d8361229cde88d68f0c96ed0b8 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 --- lib/version.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/version.js b/lib/version.js index 4439f679b3b89..265b049bf3914 100644 --- a/lib/version.js +++ b/lib/version.js @@ -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(() => {