This commit is contained in:
10
build.py
10
build.py
@ -5,6 +5,7 @@ import hashlib
|
||||
import time
|
||||
import zipfile
|
||||
import importlib.util
|
||||
import json
|
||||
|
||||
current_dir = os.getcwd()
|
||||
|
||||
@ -58,6 +59,15 @@ def copyFiles(src, dst):
|
||||
dst_file = os.path.join(dest_path, file)
|
||||
shutil.copy2(src_file, dst_file) # Overwrites if exists
|
||||
|
||||
if dst_file.endswith(".json") or dst_file.endswith(".mcmeta"):
|
||||
content = ""
|
||||
with open(dst_file, "r") as file:
|
||||
content = file.read()
|
||||
content = json.loads(content)
|
||||
content = json.dumps(content, separators=(',', ':'))
|
||||
with open(dst_file, "w") as file:
|
||||
file.write(content)
|
||||
|
||||
def zip_folder(folder_path, zip_file_path):
|
||||
with zipfile.ZipFile(zip_file_path, 'w', zipfile.ZIP_DEFLATED) as zipf:
|
||||
for root, dirs, files in os.walk(folder_path):
|
||||
|
||||
Reference in New Issue
Block a user