Skip to content
Snippets Groups Projects
Commit 369d6d11 authored by Jens Schneider's avatar Jens Schneider
Browse files

Another try to check for the current branch during installation

parent ed9bf255
No related branches found
No related tags found
1 merge request!10- major changes in feedback
......@@ -22,10 +22,13 @@ def get_version():
try:
git_describe = subprocess.check_output(["git", "describe", "--tags"])
git_describe = git_describe.decode("utf-8").strip()
git_branch = subprocess.check_output(["git", "branch", "--show-current"])
git_branch = git_branch.decode("utf-8").strip()
f = open('version.txt', 'w')
f.write(git_describe)
f.writelines([git_describe, "\n", git_branch])
f.close()
# and do it one more for packaging if possible
# f = open('src/rwth-nb/version.txt','w')
# f.write(git_describe)
......@@ -33,6 +36,7 @@ def get_version():
except:
f = open('version.txt', 'r')
git_describe = f.readline()
git_branch = f.readline()
f.close()
# check whether
......@@ -41,7 +45,6 @@ def get_version():
version = git_describe
split_describe = git_describe.split('-')
git_branch = subprocess.check_output(["git", "branch", "--show-current"])
if (len(split_describe) > 1 and git_branch == "master"):
raise Exception("I do not want to build this package since you did not tag your current state of work.")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment