From ae032bfa9268a0a14351b0d78b6deedee7891e3a Mon Sep 17 00:00:00 2001 From: Andrea Torlaschi Date: Tue, 14 Jul 2020 03:20:42 +0200 Subject: [PATCH] fix: Commit message and tag name is no longer enclosed in quotes. (#619) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Authored by @runnerway – runExecFile (`child_process.execFile`) does not need additional quotes/escaping. Closes #621, #620 --- lib/lifecycles/commit.js | 2 +- lib/lifecycles/tag.js | 2 +- test.js | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/lifecycles/commit.js b/lib/lifecycles/commit.js index a4bdb7909..bcde6f28a 100644 --- a/lib/lifecycles/commit.js +++ b/lib/lifecycles/commit.js @@ -67,7 +67,7 @@ function execCommit (args, newVersion) { args.commitAll ? [] : toAdd, [ '-m', - `"${formatCommitMessage(args.releaseCommitMessageFormat, newVersion)}"` + `${formatCommitMessage(args.releaseCommitMessageFormat, newVersion)}` ] ) ) diff --git a/lib/lifecycles/tag.js b/lib/lifecycles/tag.js index 214e69c92..f160ce743 100644 --- a/lib/lifecycles/tag.js +++ b/lib/lifecycles/tag.js @@ -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() diff --git a/test.js b/test.js index 5b011fdba..83627fa66 100644 --- a/test.js +++ b/test.js @@ -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() })