Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(i18n/update-source): handle single quotes in commit messages #23758

Merged

Conversation

pieh
Copy link
Contributor

@pieh pieh commented May 4, 2020

Fixes problems when commit message in master contains single quotes - like 091194b - which caused https://circleci.com/gh/gatsbyjs/gatsby/395925?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link

@pieh pieh requested a review from a team as a code owner May 4, 2020 18:40
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label May 4, 2020
@pieh pieh added type: chore type: maintenance An issue or pull request describing a change that isn't a bug, feature or documentation change and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer type: maintenance An issue or pull request describing a change that isn't a bug, feature or documentation change labels May 4, 2020
// http://blog.stvjam.es/2016/11/using-quotes-in-git-command-line-commit-messages/#Using-Single-Quotes
if (
shell.exec(
`git commit -m '${commitMessage.replace(/'/g, `'\\''`)}' > /dev/null`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand this but I trust it works

Copy link
Contributor

@sidharthachatterjee sidharthachatterjee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💥

@sidharthachatterjee sidharthachatterjee merged commit 8a82187 into master May 5, 2020
@sidharthachatterjee sidharthachatterjee deleted the fix-update-source-single-quote-escaping branch May 5, 2020 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants