From 426ee567bc235cd18af5e64e4f840bded453cc8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20A=2E=20Ortega?= Date: Sun, 24 Apr 2016 00:14:58 +0200 Subject: [PATCH] Ask if you want to remove the files. --- oga-converter.sh | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/oga-converter.sh b/oga-converter.sh index 7bb2ca3..69da90e 100755 --- a/oga-converter.sh +++ b/oga-converter.sh @@ -4,7 +4,7 @@ while true do - read -p "Should Oga-Converter confirm each conversion? (y/n)" ANSWER + read -p "Should Oga-Converter confirm each conversion? (y/n) " ANSWER case $ANSWER in [yY]* ) CONFIRMATION=true break;; @@ -39,3 +39,22 @@ do ffmpeg -loglevel warning -i $f $OUTFILE.oga fi done + +while true +do + read -p "Do you wish to delete the old files? (y/n) " ANSWER + case $ANSWER in + [yY]* ) echo "Deleting the old files..." + for f in $@ + do + rm $f + done + echo "Done." + break;; + + [nN]* ) echo "Goodbye!" + break;; + + * ) echo "Please enter a valid option." + esac +done