Skip to content

Commit

Permalink
version control updates
Browse files Browse the repository at this point in the history
  • Loading branch information
yserdem committed Feb 11, 2025
1 parent 6941cfb commit 8c2c0c1
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions canvas/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,15 @@ def get_default_gateway_linux():


def get_version():
with open(settings.BASE_DIR.joinpath(".git/FETCH_HEAD")) as f:
return f.read().splitlines()[0][:6]

try:
with open(settings.BASE_DIR.joinpath(".git/FETCH_HEAD")) as f:
return f.read().splitlines()[0][:6]
except FileNotFoundError:
try:
with open(settings.BASE_DIR.joinpath(".git/refs/heads/release")) as f:
return f.read().strip()[:6]
except FileNotFoundError:
return "no version"

def start_run(chip_id):
if not settings.DEBUG:
Expand Down

0 comments on commit 8c2c0c1

Please sign in to comment.