Skip to content

Commit

Permalink
- Fix git version fallback if git repo not found (#135)
Browse files Browse the repository at this point in the history
  • Loading branch information
nwithan8 authored Sep 5, 2023
1 parent 1b20419 commit 06ceeec
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions modules/statics.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,11 @@
def splash_logo() -> str:
version = VERSION
if "GITHUB" in version:
last_commit = subprocess.check_output(["git", "rev-parse", "HEAD"]).decode("utf-8").strip()
version = f"git-{last_commit[:7]}"
try:
last_commit = subprocess.check_output(["git", "rev-parse", "HEAD"]).decode("utf-8").strip()
version = f"git-{last_commit[:7]}"
except subprocess.SubprocessError:
version = "git-unknown-commit"
return f"""
{ASCII_ART}
Version {version}, Python {sys.version}
Expand Down

0 comments on commit 06ceeec

Please sign in to comment.