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##*\\}"
# 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
}