From 558a8a076599170dc626fc77887630d602221314 Mon Sep 17 00:00:00 2001 From: SinTan1729 Date: Fri, 29 Jul 2022 22:41:54 -0500 Subject: [PATCH] Prompt before permanent delete --- latex-cleanup | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/latex-cleanup b/latex-cleanup index 0294a79..dcde2b3 100644 --- a/latex-cleanup +++ b/latex-cleanup @@ -6,7 +6,10 @@ # Pass "-delete" to delete files instead of trashing. if [ "$1" = "--delete" ]; then - echo "Warning: Deleting instead of trashing." + read -p "Warning: Deleting instead of trashing. Continue? [y/N]: " resp + if [ $resp != "y" ] && [ $resp != "Y" ]; then + exit + fi d=1 else echo "Trashing files by default, pass --delete to delete instead."