Skip to content

Commit

Permalink
rename, update packer.py
Browse files Browse the repository at this point in the history
  • Loading branch information
EvanHsieh0415 committed Nov 17, 2023
1 parent 76d66da commit 475706d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 20 deletions.
20 changes: 0 additions & 20 deletions modpack_packer.py

This file was deleted.

25 changes: 25 additions & 0 deletions modpacker.py
Original file line number Diff line number Diff line change
@@ -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")

0 comments on commit 475706d

Please sign in to comment.