From 5609232858950a676434adc7a96a722ae27dba76 Mon Sep 17 00:00:00 2001 From: Francis Rowe Date: Sat, 29 Aug 2015 16:57:04 -0400 Subject: download script: ask before replacing an already downloaded module --- diff --git a/download b/download index b3766f5..688d5c9 100755 --- a/download +++ b/download @@ -52,5 +52,17 @@ case ${@} in esac for programme in ${programmes}; do + + if [ -d "${programme}/" ]; then + printf "A ${programme}/ directory already exists, delete it? [yN]: " + read answer + if [ "${answer}" = "y" ]; then + rm -Rf "${programme}/" && printf "Old ${programme} directory deleted.\n\n" + else + printf "${programme} directory not deleted, and therefore not replaced.\n" + continue + fi + fi + ${download}/${programme} done -- cgit v0.9.1