Skip to content
Permalink
Browse files
fix: Commit message and tag name is no longer enclosed in quotes. (#619)
- Authored by @runnerway – runExecFile (`child_process.execFile`) does not need additional quotes/escaping.

Closes #621, #620
  • Loading branch information
runnerway committed Jul 14, 2020
1 parent 57e4e25 commit ae032bfa9268a0a14351b0d78b6deedee7891e3a
Showing with 4 additions and 4 deletions.
  1. +1 −1 lib/lifecycles/commit.js
  2. +1 −1 lib/lifecycles/tag.js
  3. +2 −2 test.js
@@ -67,7 +67,7 @@ function execCommit (args, newVersion) {
args.commitAll ? [] : toAdd,
[
'-m',
`"${formatCommitMessage(args.releaseCommitMessageFormat, newVersion)}"`
`${formatCommitMessage(args.releaseCommitMessageFormat, newVersion)}`
]
)
)
@@ -25,7 +25,7 @@ function execTag (newVersion, pkgPrivate, args) {
tagOption = '-a'
}
checkpoint(args, 'tagging release %s%s', [args.tagPrefix, newVersion])
return runExecFile(args, 'git', ['tag', tagOption, args.tagPrefix + newVersion, '-m', `"${formatCommitMessage(args.releaseCommitMessageFormat, newVersion)}"`])
return runExecFile(args, 'git', ['tag', tagOption, args.tagPrefix + newVersion, '-m', `${formatCommitMessage(args.releaseCommitMessageFormat, newVersion)}`])
.then(() => runExecFile('', 'git', ['rev-parse', '--abbrev-ref', 'HEAD']))
.then((currentBranch) => {
let message = 'git push --follow-tags origin ' + currentBranch.trim()
@@ -263,8 +263,8 @@ describe('cli', function () {
return line ? JSON.parse(line) : line
})
/* eslint-disable no-useless-escape */
captured[captured.length - 4].should.deep.equal(['commit', '-S', 'CHANGELOG.md', 'package.json', '-m', '\"chore(release): 1.0.1\"'])
captured[captured.length - 3].should.deep.equal(['tag', '-s', 'v1.0.1', '-m', '\"chore(release): 1.0.1\"'])
captured[captured.length - 4].should.deep.equal(['commit', '-S', 'CHANGELOG.md', 'package.json', '-m', 'chore(release): 1.0.1'])
captured[captured.length - 3].should.deep.equal(['tag', '-s', 'v1.0.1', '-m', 'chore(release): 1.0.1'])
/* eslint-enable no-useless-escape */
unmock()
})

0 comments on commit ae032bf

Please sign in to comment.