diff --git a/src/app.py b/src/app.py index 355bef8..b9c9aac 100644 --- a/src/app.py +++ b/src/app.py @@ -58,6 +58,13 @@ def main( stream.film_grain = film_grain export_data = " ".join(data.cmd()) export_path = Path(filename).parent / "encode.sh" + # Confirm overwrite if script exists + if export_path.exists(): + if not typer.confirm(f"'{export_path}' already exists. Overwrite? "): + typer.echo("Aborting.") + raise typer.Exit() + else: + export_path.unlink() write_shell_script(export_data, export_path) print(Path(filename).parent) print(" ".join(data.cmd()))