Skip to content

Commit c0d48cf

Browse files
committed
retroarch-release.sh: Ask before removing the directory.
Someone might run this script without realizing what it does.
1 parent 28e3515 commit c0d48cf

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

retroarch-release.sh

+11-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
2-
# vim: set ts=3 sw=3 noet ft=sh : bash
3-
# RetroArch packaging script
2+
# vim: set ts=3 sw=3 noet ft=sh : sh
3+
# RetroArch packaging script for release tarballs
44

55
PRGNAM=RetroArch
66
SRCNAM="$(printf %s $PRGNAM | tr '[:upper:]' '[:lower:]')"
@@ -10,7 +10,15 @@ TMP=${TMP:-/tmp/libretro}
1010
set -eu
1111

1212
# Ensure a clean and fully updated repo
13-
[ -d $SRCNAM ] && rm -rf -- $SRCNAM
13+
if [ -d $SRCNAM ]; then
14+
printf %s\\n "WARNING: The $PRGNAM directory already exists." \
15+
"Remove the $PRGNAM directory and continue? (y/n)" >&2
16+
read -r answer
17+
case "$answer" in
18+
[yY]|[yY][eE][sS] ) rm -rf -- $SRCNAM ;;
19+
* ) printf %s\\n 'Exiting ...'; exit 0 ;;
20+
esac
21+
fi
1422

1523
./libretro-fetch.sh $SRCNAM
1624

0 commit comments

Comments
 (0)