mirror of
https://github.com/RetroDECK/RetroDECK.git
synced 2025-04-10 19:15:12 +00:00
Add core userdata backup option to post_update and give user option to exit update process if backup fails
This commit is contained in:
parent
2004cc7a3e
commit
fafba97ad4
|
@ -23,7 +23,13 @@ post_update() {
|
||||||
case $choice in
|
case $choice in
|
||||||
"Backup Core Userdata" )
|
"Backup Core Userdata" )
|
||||||
log i "User chose to backup core userdata prior to update."
|
log i "User chose to backup core userdata prior to update."
|
||||||
backup_retrodeck_userdata "core"
|
if ! backup_retrodeck_userdata "core"; then
|
||||||
|
log d "Userdata backup failed, giving option to proceed"
|
||||||
|
if [[ $(configurator_generic_question_dialog "RetroDECK Update" "Unfortunately the userdata backup process was not successful.\nWould you like to proceed with the upgrade anyway?\n\nRetroDECK will exit if you choose \"No\"") == "false" ]]; then
|
||||||
|
log d "User chose to stop post_update process after backup failure"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
"Backup Some Userdata" )
|
"Backup Some Userdata" )
|
||||||
log i "User chose to backup some userdata prior to update."
|
log i "User chose to backup some userdata prior to update."
|
||||||
|
@ -50,11 +56,23 @@ post_update() {
|
||||||
choices=() # Expand choice string into passable array
|
choices=() # Expand choice string into passable array
|
||||||
IFS='^' read -ra choices <<< "$choice"
|
IFS='^' read -ra choices <<< "$choice"
|
||||||
|
|
||||||
backup_retrodeck_userdata "custom" "${choices[@]}" # Expand array of choices into individual arguments
|
if ! backup_retrodeck_userdata "custom" "${choices[@]}"; then # Expand array of choices into individual arguments
|
||||||
|
log d "Userdata backup failed, giving option to proceed"
|
||||||
|
if [[ $(configurator_generic_question_dialog "RetroDECK Update" "Unfortunately the userdata backup process was not successful.\nWould you like to proceed with the upgrade anyway?\n\nRetroDECK will exit if you choose \"No\"") == "false" ]]; then
|
||||||
|
log d "User chose to stop post_update process after backup failure"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
"Backup All Userdata" )
|
"Backup All Userdata" )
|
||||||
log i "User chose to backup all userdata prior to update."
|
log i "User chose to backup all userdata prior to update."
|
||||||
backup_retrodeck_userdata "complete"
|
if ! backup_retrodeck_userdata "complete"; then
|
||||||
|
log d "Userdata backup failed, giving option to proceed"
|
||||||
|
if [[ $(configurator_generic_question_dialog "RetroDECK Update" "Unfortunately the userdata backup process was not successful.\nWould you like to proceed with the upgrade anyway?\n\nRetroDECK will exit if you choose \"No\"") == "false" ]]; then
|
||||||
|
log d "User chose to stop post_update process after backup failure"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue