summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xauto-installer.sh3
-rw-r--r--includes/generic-includes.sh8
2 files changed, 9 insertions, 2 deletions
diff --git a/auto-installer.sh b/auto-installer.sh
index 655bbaa..b3ec696 100755
--- a/auto-installer.sh
+++ b/auto-installer.sh
@@ -89,6 +89,9 @@ done
[ -z "$TARGETDIR" ] && [ -n "$SHORTGAMENAME" ] && export TARGETDIR="$PWD/$SHORTGAMENAME"
[ -z "$TARGETDIR" ] && diequietly
+# if targetdir already exists, make sure we never clobber it
+[ -d "$TARGETDIR" ] && export alwaysdiesafely=1
+
echo "$FULLGAMENAME detected, installing"
"$scriptdir/$MINSCRIPT" -i "$TARGETDIR" -c "$CDMOUNT" 1>/dev/null || diequietly
diff --git a/includes/generic-includes.sh b/includes/generic-includes.sh
index 983853a..43474af 100644
--- a/includes/generic-includes.sh
+++ b/includes/generic-includes.sh
@@ -25,8 +25,12 @@
function die
{
- echo "Install can not continue, cleaning up partial install"
- rm -rf "$TARGETDIR"
+ echo "Install can not continue"
+
+ if [ "$alwaysdiesafely" != "1" ]; then
+ echo "Cleaning up partial install"
+ rm -rf "$TARGETDIR"
+ fi
echo ""
echo "The install failed; sorry."