-
Notifications
You must be signed in to change notification settings - Fork 263
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
[ACS-5400] Fix incomplete string escaping #8721
[ACS-5400] Fix incomplete string escaping #8721
Conversation
@@ -109,7 +109,7 @@ function getCommits(options: DiffOptions): Array<Commit> { | |||
let log = shell.exec(command, { cwd: options.dir, silent: true }).toString(); | |||
|
|||
// https://stackoverflow.com/a/13928240/14644447 | |||
log = log.trim().replace(/"/gm, '\\"').replace(/\^@\^/gm, '"'); | |||
log = JSON.stringify(log.trim()).slice(1, -1).replace(/\^@\^/gm, '"'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'm not sure it is going to work as log is not an object so you can't stringify it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
log
is a string, we use JSON.stringity
to escape the quotes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did you test the changelog command? does it produce the expected output?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a fix, now works as expected
29d3e71
to
d295e82
Compare
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Please check if the PR fulfills these requirements
What kind of change does this PR introduce? (check one with "x")
What is the current behaviour? (You can also link to an open issue here)
https://alfresco.atlassian.net/browse/ACS-5400
What is the new behaviour?
Fixed incomplete string escaping
Does this PR introduce a breaking change? (check one with "x")
If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...
Other information: