Skip to content

Commit

Permalink
Bugfix/escape quotes windows (#613)
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippeRoy committed Mar 4, 2020
1 parent 2dc01ba commit 4d01971
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/plugin/git/Git.js
@@ -1,6 +1,6 @@
const _ = require('lodash');
const findUp = require('find-up');
const { quote } = require('shell-quote');
const shellescape = require('any-shell-escape');
const { format } = require('../../util');
const GitBase = require('../GitBase');
const {
Expand Down Expand Up @@ -133,7 +133,7 @@ class Git extends GitBase {
}

commit({ message = this.options.commitMessage, args = this.options.commitArgs } = {}) {
const quotedMessage = quote([format(message, this.getContext())]);
const quotedMessage = shellescape([format(message, this.getContext())]);
return this.exec(`git commit --message=${quotedMessage} ${args || ''}`).then(
() => this.setContext({ isCommitted: true }),
err => {
Expand All @@ -148,7 +148,7 @@ class Git extends GitBase {
}

tag({ name = this.options.tagName, annotation = this.options.tagAnnotation, args = this.options.tagArgs } = {}) {
const quotedMessage = quote([format(annotation, this.getContext())]);
const quotedMessage = shellescape([format(annotation, this.getContext())]);
return this.exec(`git tag --annotate --message=${quotedMessage} ${args || ''} ${name}`)
.then(() => this.setContext({ isTagged: true }))
.catch(err => {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -57,6 +57,7 @@
"dependencies": {
"@iarna/toml": "2.2.3",
"@octokit/rest": "16.43.1",
"any-shell-escape": "0.1.1",
"async-retry": "1.3.1",
"chalk": "3.0.0",
"cosmiconfig": "5.2.1",
Expand All @@ -76,7 +77,6 @@
"ora": "4.0.3",
"os-name": "3.1.0",
"semver": "7.1.3",
"shell-quote": "1.7.2",
"shelljs": "0.8.3",
"supports-color": "7.1.0",
"update-notifier": "4.1.0",
Expand Down

0 comments on commit 4d01971

Please sign in to comment.