Skip to content

Commit

Permalink
fix for when master and develop are the same
Browse files Browse the repository at this point in the history
  • Loading branch information
bullmoose20 committed Feb 17, 2025
1 parent 8cac9b3 commit 6dde8f5
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions modules/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import os
import re
import requests
import subprocess
import time
from flask import current_app as app
from pathlib import Path
Expand Down Expand Up @@ -131,8 +132,17 @@ def get_local_version():
with open(version_file, "r", encoding="utf-8") as f:
local_version = f.read().strip()

# Determine branch based on whether "build" is in the file
branch = "develop" if "build" in local_version.lower() else "master"
# Use Git to determine the current branch
try:
branch = (
subprocess.check_output(
["git", "rev-parse", "--abbrev-ref", "HEAD"], stderr=subprocess.DEVNULL
)
.decode("utf-8")
.strip()
)
except subprocess.CalledProcessError:
branch = "unknown" # Fallback if not a git repo

return local_version, branch

Expand Down

0 comments on commit 6dde8f5

Please sign in to comment.