Files
mtgodot-poc/assets/pack.py
T
shenandClaude Sonnet 5 2277b1dd60 Vendor Metin2 assets (assets/ + bgm/)
Committed to this self-hosted private repo so a clone builds on any machine
without a separate asset sync. Copyrighted Ymir art — do not publish or
redistribute. 54198 files, ~2.2 GB. asset_index.txt / assets.zip stay
gitignored (derived: bake_asset_index.gd / pack-assets.sh).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013EJxkHiNKS4kybHS3XKyAJ
2026-08-31 20:04:32 +09:00

52 lines
1.5 KiB
Python

import subprocess
import shutil
import os
import sys
import argparse
from concurrent.futures import ThreadPoolExecutor
output_folder_path = "../pack"
IGNORE_FOLDERS = {
"zz_ignore_old"
}
def pack_folder(folder_path):
folder_name = os.path.basename(folder_path)
if not os.path.exists(folder_name):
print(f"Error: Folder \"{folder_name}\" doesn't exist")
return
try:
result = subprocess.run(["PackMaker.exe", "--input", folder_name, "--output", output_folder_path], check=True)
except subprocess.CalledProcessError as e:
print(f"Error occurred while packing {folder_name}: {e}")
return
def pack_all_folders():
all_folders = [f for f in os.listdir() if os.path.isdir(f) and f not in IGNORE_FOLDERS]
with ThreadPoolExecutor() as executor:
executor.map(pack_folder, all_folders)
def main():
parser = argparse.ArgumentParser(description="Pack folders for the game.")
parser.add_argument("folder_name", nargs="?", help="The name of the folder to pack")
parser.add_argument("--all", action="store_true", help="Pack all folders")
args = parser.parse_args()
if not os.path.exists(output_folder_path):
os.makedirs(output_folder_path)
if args.all:
pack_all_folders()
elif args.folder_name:
folder_path = os.path.abspath(args.folder_name)
pack_folder(folder_path)
else:
print("Please provide a folder name or use the --all option to pack all folders.")
if __name__ == "__main__":
main()