Extract default branch name
This commit is contained in:
@@ -7,9 +7,10 @@ import subprocess
|
|||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
default_branch = "main"
|
||||||
branch = subprocess.check_output("git rev-parse --abbrev-ref HEAD", shell=True).decode().strip()
|
branch = subprocess.check_output("git rev-parse --abbrev-ref HEAD", shell=True).decode().strip()
|
||||||
if branch != "main":
|
if branch != default_branch:
|
||||||
print("Aborting, not on 'main' branch.")
|
print(f"Aborting, not on '{default_branch}' branch.")
|
||||||
return
|
return
|
||||||
|
|
||||||
version_filepath = os.path.join(os.path.basename(os.path.dirname(__file__)), "__init__.py")
|
version_filepath = os.path.join(os.path.basename(os.path.dirname(__file__)), "__init__.py")
|
||||||
|
|||||||
Reference in New Issue
Block a user