mirror of
https://github.com/RetroDECK/RetroDECK.git
synced 2024-11-25 23:45:39 +00:00
Added more safety around the cooker reset option
This commit is contained in:
parent
26bf3f5dfc
commit
b91c451fdd
20
retrodeck.sh
20
retrodeck.sh
|
@ -106,6 +106,7 @@ if [ -f "$lockfile" ]; then
|
||||||
if [ "$hard_version" != "$version" ]; then
|
if [ "$hard_version" != "$version" ]; then
|
||||||
echo "Config file's version is $version but the actual version is $hard_version"
|
echo "Config file's version is $version but the actual version is $hard_version"
|
||||||
if grep -qF "cooker" <<< $hard_version; then # If newly-installed version is a "cooker" build
|
if grep -qF "cooker" <<< $hard_version; then # If newly-installed version is a "cooker" build
|
||||||
|
configurator_generic_dialog "RetroDECK Cooker Warning" "RUNNING COOKER VERSIONS OF RETRODECK CAN BE EXTREMELY DANGEROUS AND ALL OF YOUR RETRODECK DATA\n(INCLUDING BIOS FILES, BORDERS, DOWNLOADED MEDIA, GAMELISTS, MODS, ROMS, SAVES, STATES, SCREENSHOTS, TEXTURE PACKS AND THEMES)\nARE AT RISK BY CONTINUING!"
|
||||||
cooker_base_version=$(echo $hard_version | cut -d'-' -f2)
|
cooker_base_version=$(echo $hard_version | cut -d'-' -f2)
|
||||||
choice=$(zenity --icon-name=net.retrodeck.retrodeck --info --no-wrap --ok-label="Upgrade" --extra-button="Don't Upgrade" --extra-button="Full Wipe and Fresh Install" \
|
choice=$(zenity --icon-name=net.retrodeck.retrodeck --info --no-wrap --ok-label="Upgrade" --extra-button="Don't Upgrade" --extra-button="Full Wipe and Fresh Install" \
|
||||||
--window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
|
--window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
|
||||||
|
@ -117,11 +118,20 @@ if [ -f "$lockfile" ]; then
|
||||||
echo "Skipping upgrade process for cooker build, updating stored version in retrodeck.cfg"
|
echo "Skipping upgrade process for cooker build, updating stored version in retrodeck.cfg"
|
||||||
set_setting_value $rd_conf "version" "$hard_version" retrodeck # Set version of currently running RetroDECK to updated retrodeck.cfg
|
set_setting_value $rd_conf "version" "$hard_version" retrodeck # Set version of currently running RetroDECK to updated retrodeck.cfg
|
||||||
elif [[ $choice == "Full Wipe and Fresh Install" ]]; then # Remove all RetroDECK data and start a fresh install
|
elif [[ $choice == "Full Wipe and Fresh Install" ]]; then # Remove all RetroDECK data and start a fresh install
|
||||||
echo "Removing RetroDECK data and starting fresh"
|
if [[ $(configurator_generic_question_dialog "RetroDECK Cooker Reset" "This is going to remove all of the data in all locations used by RetroDECK!\n\n(INCLUDING BIOS FILES, BORDERS, DOWNLOADED MEDIA, GAMELISTS, MODS, ROMS, SAVES, STATES, SCREENSHOTS, TEXTURE PACKS AND THEMES)\n\nAre you sure you want to contine?") == "true" ]]; then
|
||||||
rm -rf /var
|
if [[ $(configurator_generic_question_dialog "RetroDECK Cooker Reset" "Are you super sure?\n\nThere is no going back from this process, everything is gonzo.\nDust in the wind.\n\nYesterdays omelette.") == "true" ]]; then
|
||||||
rm -rf "$HOME/retrodeck"
|
if [[ $(configurator_generic_question_dialog "RetroDECK Cooker Reset" "But are you super DUPER sure? We REAAAALLLLLYY want to make sure you know what is happening here.\n\nThe ~/retrodeck and ~/.var/app/net.retrodeck.retrodeck folders and ALL of their contents\nare about to be PERMANENTLY removed.\n\nStill sure you want to proceed?") == "true" ]]; then
|
||||||
source /app/libexec/global.sh
|
configurator_generic_dialog "RetroDECK Cooker Reset" "Ok, if you're that sure, here we go!"
|
||||||
finit
|
if [[ $(configurator_generic_question_dialog "RetroDECK Cooker Reset" "(Are you actually being serious here? Because we are...\n\nNo backsies.)") == "true" ]]; then
|
||||||
|
echo "Removing RetroDECK data and starting fresh"
|
||||||
|
rm -rf /var
|
||||||
|
rm -rf "$HOME/retrodeck"
|
||||||
|
source /app/libexec/global.sh
|
||||||
|
finit
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "Performing normal upgrade process for version" $cooker_base_version
|
echo "Performing normal upgrade process for version" $cooker_base_version
|
||||||
|
|
Loading…
Reference in a new issue