Skip to content
This repository was archived by the owner on Jun 25, 2022. It is now read-only.

Commit 7aa02e4

Browse files
author
pathmann
committed
read version from file
1 parent 42e6c09 commit 7aa02e4

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

tools/bundle.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@
146146
Name = pyTSon
147147
Type = Plugin
148148
Author = Thomas \\"PLuS\\" Pathmann
149-
Version = 1.2.1
149+
Version = %s
150150
Platforms = %s
151151
Description = "pyTSon - A python plugin to enhance the TS3 client with python\
152152
scripts"
@@ -168,6 +168,14 @@ def writeFiles(root, files, tozip):
168168

169169

170170
def main(root, pythondir, outdir, arches, buildbase, update):
171+
verpath = os.path.join(root, "VERSION")
172+
if not os.path.isfile(verpath):
173+
print("Could not find VERSION file in rootdir")
174+
sys.exit(1)
175+
176+
with open(verpath, "r") as f:
177+
ver = f.readline()
178+
171179
for a in arches:
172180
if update:
173181
shutil.copyfile(os.path.join(outdir, "pyTSon_%s.base" % a),
@@ -194,7 +202,7 @@ def main(root, pythondir, outdir, arches, buildbase, update):
194202
writeFiles(pythondir, PYTHONFILES[a], zipout)
195203

196204
if not buildbase:
197-
zipout.writestr("package.ini", INIBASE % a)
205+
zipout.writestr("package.ini", INIBASE % (ver, a))
198206

199207
zipout.close()
200208

0 commit comments

Comments
 (0)