branding: have counters by branch

This commit is contained in:
ave 2019-01-25 16:23:07 +03:00
parent bbd4d43990
commit 993ad39c2d
No known key found for this signature in database
GPG Key ID: 09356ABAA42C842B
1 changed files with 4 additions and 4 deletions

View File

@ -6,9 +6,9 @@ fname = sys.argv[1]
persistdir = "/home/ave/distokrepos/versionlogs/"
def counterup():
def counterup(branch="base"):
# HACKY
cfname = persistdir + fname.split("/")[-1].replace(".patch", "")
cfname = persistdir + fname.split("/")[-1].replace(".patch", "") + branch
if os.path.isfile(cfname):
with open(cfname, 'r') as file:
countdata = file.read()
@ -27,8 +27,6 @@ def counterup():
with open(fname, 'r') as file:
filedata = file.read()
buildnum = str(counterup())
name = "CutTheCord"
branch = "base"
@ -36,6 +34,8 @@ if "customtheme" in sys.argv:
branch = "themed"
# name += " Themed"
buildnum = str(counterup(branch))
# Replace the target string
filedata = filedata.replace("CTCBRANCH", branch)\
.replace("CTCBUILD", buildnum)\