10
9/build.py
Normal file
@ -0,0 +1,10 @@
|
||||
import os
|
||||
|
||||
current_dir = os.getcwd()
|
||||
|
||||
# Removing all .md files
|
||||
for root, dirs, files in os.walk(current_dir):
|
||||
for file in files:
|
||||
src_file = os.path.join(root, file)
|
||||
if os.path.isfile(src_file) and file.endswith(".md"):
|
||||
os.remove(src_file)
|
||||
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):
|
||||
|
||||
|
Before Width: | Height: | Size: 606 B After Width: | Height: | Size: 606 B |
|
Before Width: | Height: | Size: 607 B After Width: | Height: | Size: 607 B |
|
Before Width: | Height: | Size: 610 B After Width: | Height: | Size: 610 B |
|
Before Width: | Height: | Size: 607 B After Width: | Height: | Size: 607 B |
|
Before Width: | Height: | Size: 610 B After Width: | Height: | Size: 610 B |
|
Before Width: | Height: | Size: 610 B After Width: | Height: | Size: 610 B |
|
Before Width: | Height: | Size: 610 B After Width: | Height: | Size: 610 B |
|
Before Width: | Height: | Size: 609 B After Width: | Height: | Size: 609 B |
|
Before Width: | Height: | Size: 612 B After Width: | Height: | Size: 612 B |
|
Before Width: | Height: | Size: 606 B After Width: | Height: | Size: 606 B |
|
Before Width: | Height: | Size: 613 B After Width: | Height: | Size: 613 B |
|
Before Width: | Height: | Size: 608 B After Width: | Height: | Size: 608 B |
|
Before Width: | Height: | Size: 608 B After Width: | Height: | Size: 608 B |
|
Before Width: | Height: | Size: 611 B After Width: | Height: | Size: 611 B |
|
Before Width: | Height: | Size: 607 B After Width: | Height: | Size: 607 B |
|
Before Width: | Height: | Size: 614 B After Width: | Height: | Size: 614 B |