mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-12 17:04:57 +00:00
[ACS-5400] Fix incomplete string escaping (#8721)
* [ACS-5400] string escaping fix * [ACS-5400] Unexpected token in json fix
This commit is contained in:
parent
48898df0fa
commit
312562889c
@ -109,12 +109,12 @@ 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, '"');
|
||||
if (log.endsWith(',')) {
|
||||
log = log.substring(0, log.length - 1);
|
||||
}
|
||||
|
||||
return log.split('\n').map(str => JSON.parse(str) as Commit).filter(commit => commitAuthorAllowed(commit, authorFilter));
|
||||
return log.split('\\n').map(str => JSON.parse(str) as Commit).filter(commit => commitAuthorAllowed(commit, authorFilter));
|
||||
}
|
||||
|
||||
function commitAuthorAllowed(commit: Commit, authorFilter: string): boolean {
|
||||
|
Loading…
x
Reference in New Issue
Block a user