From 06138485ac1de62d8563db72e32c98bd339f2c79 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Wed, 23 Jun 2021 14:04:35 -0400 Subject: [PATCH] Make -r work normally for single game installations, but provide a notice about manual intervention for multigame bottles. --- audiogame-manager.sh | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/audiogame-manager.sh b/audiogame-manager.sh index c94533c..ef11b06 100755 --- a/audiogame-manager.sh +++ b/audiogame-manager.sh @@ -467,14 +467,19 @@ game_removal() { wineExec="${wineExec##*\\}" # Confirm removal get_bottle "${game%|*}" - read -rp "To remove the wine bottle \"${WINEPREFIX##*/}\" and all of its contents press enter. To cancel press control+c. " continue - # kill any previous existing wineservers for this prefix in case they didn't shut down properly. - wineserver -k - # remove the game - rm -rf "${WINEPREFIX}" + # Make sure the game can be handled by remove + if [[ "${HOME}/.local/wine/${game%|*}" == "${WINEPREFIX}" ]]; then + read -rp "To remove the wine bottle \"${WINEPREFIX##*/}\" and all of its contents press enter. To cancel press control+c. " continue + # kill any previous existing wineservers for this prefix in case they didn't shut down properly. + wineserver -k + # remove the game + rm -rf "${WINEPREFIX}" + else + read -rp "This bottle \"${WINEPREFIX##*/}\" contains multiple entries and must be handled manually. To remove only the launcher from the menu, press enter. To cancel press control+c. " continue + fi # remove the launcher - gawk -i inplace -vLine="${WINEPREFIX//\\/\\\\}" '!index($0,Line)' "$configFile" - echo "The selected wine bottle has been deleted." + gawk -i inplace -vLine="${game//\\/\\\\}" '!index($0,Line)' "$configFile" + echo "The selected item has been deleted." fi exit 0 }