From c0d48cfd25571dc0b2004b957dc2d43dcf9e10a7 Mon Sep 17 00:00:00 2001 From: orbea Date: Wed, 8 May 2019 09:17:30 -0700 Subject: [PATCH] retroarch-release.sh: Ask before removing the directory. Someone might run this script without realizing what it does. --- retroarch-release.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/retroarch-release.sh b/retroarch-release.sh index a6e9ed7d..2bea23ce 100755 --- a/retroarch-release.sh +++ b/retroarch-release.sh @@ -1,6 +1,6 @@ #!/bin/sh -# vim: set ts=3 sw=3 noet ft=sh : bash -# RetroArch packaging script +# vim: set ts=3 sw=3 noet ft=sh : sh +# RetroArch packaging script for release tarballs PRGNAM=RetroArch SRCNAM="$(printf %s $PRGNAM | tr '[:upper:]' '[:lower:]')" @@ -10,7 +10,15 @@ TMP=${TMP:-/tmp/libretro} set -eu # Ensure a clean and fully updated repo -[ -d $SRCNAM ] && rm -rf -- $SRCNAM +if [ -d $SRCNAM ]; then + printf %s\\n "WARNING: The $PRGNAM directory already exists." \ + "Remove the $PRGNAM directory and continue? (y/n)" >&2 + read -r answer + case "$answer" in + [yY]|[yY][eE][sS] ) rm -rf -- $SRCNAM ;; + * ) printf %s\\n 'Exiting ...'; exit 0 ;; + esac +fi ./libretro-fetch.sh $SRCNAM