From 5d23b26d8197e5209749526abaa2be1690b7fc81 Mon Sep 17 00:00:00 2001 From: Escartem Date: Fri, 20 Oct 2023 14:45:13 +0200 Subject: [PATCH] prevent unwanted clearing --- extract.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/extract.py b/extract.py index 8c017ce..24f1321 100644 --- a/extract.py +++ b/extract.py @@ -19,9 +19,13 @@ def main(): shutil.rmtree("temp") if os.path.exists("output") and len(os.listdir("output")) > 0: - print("The output folder will be cleared when the program runs, press a key to continue or close this window") - os.system("pause >nul") - shutil.rmtree("output") + print("The output folder needs to be cleared, continue ? [Y/N]") + select = input(">") + if select.lower() == "y": + shutil.rmtree("output") + else: + print("Aborting") + exit() # Get all files to process hdiff_files = [f for f in os.listdir("audio") if f.endswith(".pck") and os.path.exists(f"patch/{f}.hdiff")]