|
|
@@ -12,7 +12,7 @@ from path import Path
|
|
|
build_dir = constants.MAIN / "build"
|
|
|
version = constants.VERSION
|
|
|
|
|
|
-name = f"MnCheck_v{version}.zip"
|
|
|
+name = "MnCheck_v{}.zip".format(version.replace(".", "-"))
|
|
|
|
|
|
config = configparser.ConfigParser()
|
|
|
|
|
|
@@ -32,7 +32,8 @@ config["general"] = {"name" : "MnCheck",
|
|
|
"experimental" : "False",
|
|
|
"deprecated" : "False"}
|
|
|
|
|
|
-with open(build_dir / 'metadata.txt', 'w+') as mdf:
|
|
|
+with open(constants.MAIN / 'metadata.txt', 'w+') as mdf:
|
|
|
+ mdf.write("# This file was generated by the build.py script, do not modify it direcly\n".upper())
|
|
|
config.write(mdf)
|
|
|
|
|
|
with ZipFile(build_dir / name, 'w') as zip_:
|
|
|
@@ -40,7 +41,7 @@ with ZipFile(build_dir / name, 'w') as zip_:
|
|
|
def _zip_write(p):
|
|
|
if p.ext == ".pyc":
|
|
|
return
|
|
|
- zip_.write(p, p.relpath(constants.MAIN))
|
|
|
+ zip_.write(p, "MnCheck\{}".format(p.relpath(constants.MAIN)))
|
|
|
|
|
|
for f in Path(constants.MAIN / "ext").walkfiles():
|
|
|
_zip_write(f)
|
|
|
@@ -56,7 +57,6 @@ with ZipFile(build_dir / name, 'w') as zip_:
|
|
|
_zip_write(constants.MAIN / "README.md")
|
|
|
_zip_write(constants.MAIN / "icon.png")
|
|
|
_zip_write(constants.MAIN / "LICENSE")
|
|
|
-
|
|
|
- zip_.write(build_dir / "metadata.txt", "metadata.txt")
|
|
|
+ _zip_write(constants.MAIN / "metadata.txt")
|
|
|
|
|
|
Path(build_dir / "metadata.txt").remove_p()
|