Add confirmation prompt before overwriting existing encode.sh script
This commit is contained in:
@@ -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()))
|
||||
|
||||
Reference in New Issue
Block a user