1
0

Added generate reel script step

This commit is contained in:
2026-04-02 11:54:29 +02:00
parent 48a11705f3
commit e3c2b9ddee

View File

@@ -47,10 +47,12 @@ def parse_args() -> argparse.Namespace:
return parser.parse_args()
def run_step(name: str, cmd: list[str]) -> None:
def run_step(name: str, cmd: list[str], cwd: Path | None = None) -> None:
LOGGER.info("=== %s ===", name)
LOGGER.info("$ %s", " ".join(str(part) for part in cmd))
subprocess.run(cmd, check=True)
if cwd is not None:
LOGGER.info("(cwd: %s)", cwd)
subprocess.run(cmd, check=True, cwd=str(cwd) if cwd else None)
def maybe_upload_to_s3(output_path: Path) -> None:
@@ -95,6 +97,19 @@ def main() -> int:
args.output = args.base_dir / "results" / "final_output.mp4"
try:
if not args.skip_generate and not args.reel_script.exists():
run_step(
"Generate Reel Script",
[
sys.executable,
str(SCRIPT_DIR / "generate_script.py"),
],
cwd=args.base_dir,
)
if not args.reel_script.exists():
LOGGER.error("Reel script was not generated at %s", args.reel_script)
return 1
if not args.skip_generate:
run_step(
"Generate Videos",