Decompiler: Cleanup CLI and make overriding the config much easier (#1711)

* decomp: cleaned up CLI for decompiler

* decomp: much more flexible and clean decomp override mechanism

* decomp: cleanup scripts
This commit is contained in:
Tyler Wilding
2022-07-29 20:10:11 -04:00
committed by GitHub
parent a04bdff80d
commit eaac247074
12 changed files with 60 additions and 408 deletions
+15
View File
@@ -0,0 +1,15 @@
# Windows doesn't have the GNU toolchain by default, making it hard to write Taskfiles that are cross-platform
# This "solves" that
# Ensures it only will delete from the current directory
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("--path")
args = parser.parse_args()
from os import path
import shutil
if path.exists("./{}".format(args.path)):
shutil.rmtree("./{}".format(args.path))
+8
View File
@@ -42,11 +42,19 @@ decomp_config_map = {
}
}
default_config_map = {
"jak1": "jak1_ntsc_black_label.jsonc",
"jak2": "jak2_ntsc_v1.jsonc"
}
if args.game:
if args.game not in valid_games:
print("Unsupported game '{}'".format(args.game))
sys.exit(1)
curr = file["GAME"]
file["GAME"] = args.game
if (curr != file["GAME"]) or file["DECOMP_CONFIG"] not in decomp_config_map[file["GAME"]]:
file["DECOMP_CONFIG"] = default_config_map[file["GAME"]]
if args.decomp_config:
if args.decomp_config not in decomp_config_map[file["GAME"]]:
print("Unsupported decomp config '{}' for game '{}'".format(args.decomp_config, file["GAME"]))