fix: Don't fail on getTag (#98)

This commit is contained in:
CrazyMax 2020-02-14 18:25:27 +01:00 committed by GitHub
parent bd6280fd12
commit 09847f1406
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 2 deletions

7
lib/git.js generated
View File

@ -37,7 +37,12 @@ function isTagDirty(currentTag) {
exports.isTagDirty = isTagDirty;
function getTag() {
return __awaiter(this, void 0, void 0, function* () {
return yield git(['describe', '--tags', '--abbrev=0']);
try {
return yield git(['describe', '--tags', '--abbrev=0']);
}
catch (err) {
return '';
}
});
}
exports.getTag = getTag;

View File

@ -17,7 +17,11 @@ export async function isTagDirty(currentTag: string): Promise<boolean> {
}
export async function getTag(): Promise<string> {
return await git(['describe', '--tags', '--abbrev=0']);
try {
return await git(['describe', '--tags', '--abbrev=0']);
} catch (err) {
return '';
}
}
export async function getShortCommit(): Promise<string> {