Skip to content

Commit

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

Closes #621, #620
  • Loading branch information
runnerway authored Jul 14, 2020
1 parent 57e4e25 commit ae032bf
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/lifecycles/commit.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ function execCommit (args, newVersion) {
args.commitAll ? [] : toAdd,
[
'-m',
`"${formatCommitMessage(args.releaseCommitMessageFormat, newVersion)}"`
`${formatCommitMessage(args.releaseCommitMessageFormat, newVersion)}`
]
)
)
Expand Down
2 changes: 1 addition & 1 deletion lib/lifecycles/tag.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
})
Expand Down

0 comments on commit ae032bf

Please sign in to comment.