fix(clew): dump Ren'Py objects by default
This commit is contained in:
@@ -20,6 +20,7 @@ def parse_args(argv: list[str]) -> argparse.Namespace:
|
||||
)
|
||||
parser.add_argument(
|
||||
"--game-root",
|
||||
required=True,
|
||||
type=Path,
|
||||
help="Game installation root to scan.",
|
||||
)
|
||||
@@ -35,9 +36,9 @@ def parse_args(argv: list[str]) -> argparse.Namespace:
|
||||
help="Replace Clew-managed output directories.",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--dump-renpy-objects",
|
||||
"--no-renpy-object-dump",
|
||||
action="store_true",
|
||||
help="Dump compiled Ren'Py scripts from output/extracted/ to output/ast-raw/.",
|
||||
help="Skip dumping compiled Ren'Py scripts from output/extracted/ to output/ast-raw/.",
|
||||
)
|
||||
return parser.parse_args(argv)
|
||||
|
||||
@@ -156,21 +157,17 @@ def dump_renpy_objects(output_root: Path, overwrite: bool) -> None:
|
||||
|
||||
|
||||
def run(args: argparse.Namespace) -> None:
|
||||
game_root = args.game_root.resolve()
|
||||
output_root = resolve_output_root(args.output_root)
|
||||
|
||||
if args.game_root is not None:
|
||||
game_root = args.game_root.resolve()
|
||||
if not game_root.is_dir():
|
||||
LOG.critical(f"game root is not a directory: {game_root}")
|
||||
raise SystemExit(2)
|
||||
|
||||
extracted = get_output_directory(output_root, "extracted")
|
||||
extract_game_files(game_root, extracted)
|
||||
elif not args.dump_renpy_objects:
|
||||
LOG.critical("missing --game-root unless --dump-renpy-objects is set")
|
||||
if not game_root.is_dir():
|
||||
LOG.critical(f"game root is not a directory: {game_root}")
|
||||
raise SystemExit(2)
|
||||
|
||||
if args.dump_renpy_objects:
|
||||
extracted = get_output_directory(output_root, "extracted")
|
||||
extract_game_files(game_root, extracted)
|
||||
|
||||
if not args.no_renpy_object_dump:
|
||||
dump_renpy_objects(output_root, args.overwrite)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user