From 475706d53cd949879ef47608e5bc3ec6dd7e0fdf Mon Sep 17 00:00:00 2001 From: Mango Jelly Pudding Date: Fri, 17 Nov 2023 10:59:11 +0800 Subject: [PATCH] rename, update packer.py --- modpack_packer.py | 20 -------------------- modpacker.py | 25 +++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 20 deletions(-) delete mode 100644 modpack_packer.py create mode 100644 modpacker.py diff --git a/modpack_packer.py b/modpack_packer.py deleted file mode 100644 index 9b9aaf5..0000000 --- a/modpack_packer.py +++ /dev/null @@ -1,20 +0,0 @@ -import zipfile -import os - -zipped_dirs = [ - "overrides", - "manifest.json", - "modlist.html", - "README.md", -] - -version_number = "m1.0.5" - -with zipfile.ZipFile(f"Creative-Drawers-Producer-{version_number}.zip", "w") as archive: - for directory in zipped_dirs: - if os.path.isdir(directory): - for root, _, files in os.walk(directory): - for file in files: - archive.write(os.path.join(root, file)) - else: - archive.write(directory) diff --git a/modpacker.py b/modpacker.py new file mode 100644 index 0000000..66852de --- /dev/null +++ b/modpacker.py @@ -0,0 +1,25 @@ +import zipfile +import os + +zipped_dirs = [ + "overrides", + "manifest.json", + "modlist.html", + "README.md", +] +MODPACK_NAME = "Creative-Drawers-Producer" +VERSION = "m1.0.5" + +print(f"> Start Packing Modpack - {MODPACK_NAME} {VERSION}") +with zipfile.ZipFile(f"{MODPACK_NAME}-{VERSION}.zip", "w") as archive: + for directory in zipped_dirs: + if os.path.isdir(directory): + for root, _, files in os.walk(directory): + for file in files: + _path = os.path.join(root, file) + archive.write(_path) + print(f'>...> Packing "{_path}"') + else: + archive.write(directory) + print(f'>...> Packing "{directory}"') +print("> Modpack Packing Finished")