Remove debugs, expand FINIT

This commit is contained in:
icenine451 2022-11-19 16:47:45 -05:00
parent 6f93d55f7e
commit ba553982da
4 changed files with 14 additions and 17 deletions

View file

@ -61,9 +61,9 @@ move() {
if [[ $(verify_space $1 $2) ]]; then if [[ $(verify_space $1 $2) ]]; then
( (
if [[ ! -d $2 ]]; then # Create destination directory if it doesn't already exist if [[ ! -d $2 ]]; then # Create destination directory if it doesn't already exist
debug_dialog "mkdir -pv $2" mkdir -pv $2
fi fi
debug_dialog "mv -v -t $2 $1" mv -v -t $2 $1
) | ) |
zenity --icon-name=net.retrodeck.retrodeck --progress --no-cancel --pulsate --auto-close \ zenity --icon-name=net.retrodeck.retrodeck --progress --no-cancel --pulsate --auto-close \
--window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
@ -759,11 +759,11 @@ old_browse(){
zenity --question --no-wrap --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --title "RetroDECK" \ zenity --question --no-wrap --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --title "RetroDECK" \
--cancel-label="No" \ --cancel-label="No" \
--ok-label "Yes" \ --ok-label "Yes" \
--text="Your rom folder will be:\n\n$sdcard/retrodeck/roms\n\nis that ok?" --text="Your RetroDECK data folder will be:\n\n$sdcard/retrodeck\n\nis that ok?"
if [ $? == 0 ] #yes if [ $? == 0 ] #yes
then then
path_selected == true path_selected == true
roms_folder="$sdcard/retrodeck/roms" rdhome="$sdcard/retrodeck"
break break
else else
zenity --question --no-wrap --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --title "RetroDECK" --cancel-label="No" --ok-label "Yes" --text="Do you want to quit?" zenity --question --no-wrap --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --title "RetroDECK" --cancel-label="No" --ok-label "Yes" --text="Do you want to quit?"
@ -781,7 +781,7 @@ finit() {
echo "Executing finit" echo "Executing finit"
# Internal or SD Card? # Internal or SD Card?
choice=$(configurator_destination_choice_dialog "ROMs" "Welcome to the first configuration of RetroDECK.\nThe setup will be quick but please READ CAREFULLY each message in order to avoid misconfigurations.\n\nWhere do you want your roms folder to be located?" ) choice=$(configurator_destination_choice_dialog "RetroDECK data" "Welcome to the first configuration of RetroDECK.\nThe setup will be quick but please READ CAREFULLY each message in order to avoid misconfigurations.\n\nWhere do you want your RetroDECK data folder to be located?\n\nThis folder will contain all ROMs, BIOSs and scraped data." )
echo "Choice is $choice" echo "Choice is $choice"
case $choice in case $choice in
@ -793,7 +793,7 @@ finit() {
"Internal Storage" ) # Internal "Internal Storage" ) # Internal
echo "Internal selected" echo "Internal selected"
roms_folder="$rdhome/roms" rdhome="$HOME/retrodeck"
;; ;;
"SD Card" ) "SD Card" )
@ -818,13 +818,16 @@ finit() {
echo "Now quitting" echo "Now quitting"
exit 0 exit 0
else else
roms_folder="$sdcard/retrodeck/roms" # sdcard variable is correct as its given by browse function rdhome="$sdcard/retrodeck"
echo "ROMs folder = $roms_folder"
fi fi
;; ;;
esac esac
if [[ ! -d /home/deck/retrodeck && ! -L /home/deck/retrodeck ]]; then # If data stored on SD card, create /home/deck/retrodeck symlink to keep things working until configs can get modified
dir_prep "$rdhome" "/home/deck/retrodeck"
fi
mkdir -pv $roms_folder mkdir -pv $roms_folder
# TODO: after the next update of ES-DE this will not be needed # TODO: after the next update of ES-DE this will not be needed

View file

@ -54,7 +54,6 @@ fi
# If there is no config file I initalize the file with the the default values # If there is no config file I initalize the file with the the default values
if [ ! -f "$rd_conf" ] if [ ! -f "$rd_conf" ]
then then
mkdir -p /var/config/retrodeck mkdir -p /var/config/retrodeck
echo "RetroDECK config file not found in $rd_conf" echo "RetroDECK config file not found in $rd_conf"
echo "Initializing" echo "Initializing"

View file

@ -5,9 +5,9 @@ post_update() {
# post update script # post update script
echo "Executing post-update script" echo "Executing post-update script"
case $version in # Only run updates as needed local prev_version=$(sed -e 's/[\.a-z]//g' <<< $version)
"0.5.4b" ) if [[ $prev_version -le "054" ]]; then
# Finding existing ROMs folder # Finding existing ROMs folder
if [ -d "$default_sd/retrodeck" ] if [ -d "$default_sd/retrodeck" ]
@ -177,9 +177,7 @@ post_update() {
else else
echo "Version" $version "is after the save and state organization was changed, no need to sort again" echo "Version" $version "is after the save and state organization was changed, no need to sort again"
fi fi
;; fi
esac
# These commands are run every time, for now # These commands are run every time, for now

View file

@ -75,15 +75,12 @@ then
then 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"
post_update # Executing post update script post_update # Executing post update script
start_retrodeck
exit 0
fi fi
# Else, LOCKFILE IS NOT EXISTING (WAS REMOVED) # Else, LOCKFILE IS NOT EXISTING (WAS REMOVED)
# if the lock file doesn't exist at all means that it's a fresh install or a triggered reset # if the lock file doesn't exist at all means that it's a fresh install or a triggered reset
else else
echo "Lockfile not found" echo "Lockfile not found"
finit # Executing First/Force init finit # Executing First/Force init
exit 0
fi fi
# Normal Startup # Normal Startup