misc(plugin-docs): fix Windows test snapshot for git history retrieval (#5905)

* misc(plugin-docs): fix test snapshot

* Fix again
This commit is contained in:
Joshua Chen 2021-11-08 17:09:58 +08:00 committed by GitHub
parent 334b4397e7
commit a835c9bc48
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View file

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