Make -r work normally for single game installations, but provide a notice about manual intervention for multigame bottles.

This commit is contained in:
Storm Dragon 2021-06-23 14:04:35 -04:00
parent c59918f6f4
commit 06138485ac

View File

@ -467,14 +467,19 @@ game_removal() {
wineExec="${wineExec##*\\}" wineExec="${wineExec##*\\}"
# Confirm removal # Confirm removal
get_bottle "${game%|*}" get_bottle "${game%|*}"
# 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 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. # kill any previous existing wineservers for this prefix in case they didn't shut down properly.
wineserver -k wineserver -k
# remove the game # remove the game
rm -rf "${WINEPREFIX}" 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 # remove the launcher
gawk -i inplace -vLine="${WINEPREFIX//\\/\\\\}" '!index($0,Line)' "$configFile" gawk -i inplace -vLine="${game//\\/\\\\}" '!index($0,Line)' "$configFile"
echo "The selected wine bottle has been deleted." echo "The selected item has been deleted."
fi fi
exit 0 exit 0
} }