mirror of
https://github.com/open-goal/jak-project
synced 2026-08-21 14:54:53 -04:00
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:
@@ -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))
|
||||
@@ -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"]))
|
||||
|
||||
Reference in New Issue
Block a user