fix(content-docs): quotify path when retrieving git history (#6202)

* fix(content-docs): quotify path when retrieving git history

* Enable last update in dogfooding
This commit is contained in:
Joshua Chen 2021-12-27 17:27:48 +08:00 committed by GitHub
parent 7fcadd0c36
commit 3195e7feed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 69 additions and 3 deletions

View file

@ -43,12 +43,12 @@ export async function getFileLastUpdate(
return null;
}
const result = shell.exec(`git log -1 --format=%ct,%an ${filePath}`, {
const result = shell.exec(`git log -1 --format=%ct,%an "${filePath}"`, {
silent: true,
});
if (result.code !== 0) {
throw new Error(
`Retrieval of git history failed at ${filePath} with exit code ${result.code}: ${result.stderr}`,
`Retrieval of git history failed at "${filePath}" with exit code ${result.code}: ${result.stderr}`,
);
}
return getTimestampAndAuthor(result.stdout.trim());