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
2 changed files with 11 additions and 2 deletions
Generated
+6 -1
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;
+5 -1
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> {