Skip to content

Commit

Permalink
fix: Don't fail on getTag (#98)
Browse files Browse the repository at this point in the history
  • Loading branch information
crazy-max committed Feb 14, 2020
1 parent bd6280f commit 09847f1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
7 changes: 6 additions & 1 deletion lib/git.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion src/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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> {
Expand Down

0 comments on commit 09847f1

Please sign in to comment.