Configurator move function should finally work

This commit is contained in:
icenine451 2022-11-20 20:05:11 -05:00
parent 57fefdb15c
commit 170ce1b534
3 changed files with 13 additions and 13 deletions

View file

@ -460,7 +460,7 @@ dir_prep() {
if [ -d "$symlink" ]; if [ -d "$symlink" ];
then then
echo "$symlink found" #DEBUG echo "$symlink found" #DEBUG
mv -fv "$symlink" "$symlink.old" mv -f "$symlink" "$symlink.old"
fi fi
# if the real dir doesn't exist we create it # if the real dir doesn't exist we create it
@ -479,7 +479,7 @@ dir_prep() {
if [ -d "$symlink.old" ]; if [ -d "$symlink.old" ];
then then
echo "Moving the data from $symlink.old to $real" #DEBUG echo "Moving the data from $symlink.old to $real" #DEBUG
mv -fv "$symlink".old/* $real mv -f "$symlink".old/* $real
echo "Removing $symlink.old" #DEBUG echo "Removing $symlink.old" #DEBUG
rm -rf "$symlink.old" rm -rf "$symlink.old"
fi fi

View file

@ -17,7 +17,7 @@ finish-args:
- --share=ipc - --share=ipc
- --share=network - --share=network
- --device=all - --device=all
- --filesystem=~/retrodeck:create - --filesystem=home # Needed to be able to relocate / remove / create symlink at ~/retrodeck
- --filesystem=/run/media - --filesystem=/run/media
- --filesystem=/media - --filesystem=/media
- --allow=multiarch - --allow=multiarch

View file

@ -345,7 +345,6 @@ configurator_options_dialog() {
configurator_move_dialog() { configurator_move_dialog() {
if [[ -d $rdhome ]]; then if [[ -d $rdhome ]]; then
configurator_generic_dialog "This option will move the RetroDECK data folder (ROMs, saves, BIOS etc.) to a new location.\n\nPlease choose where to move the RetroDECK data folder."
destination=$(configurator_destination_choice_dialog "RetroDECK Data" "Please choose a destination for the RetroDECK data folder.") destination=$(configurator_destination_choice_dialog "RetroDECK Data" "Please choose a destination for the RetroDECK data folder.")
case $destination in case $destination in
@ -369,7 +368,7 @@ configurator_move_dialog() {
bios_folder="$rdhome/bios" bios_folder="$rdhome/bios"
media_folder="$rdhome/downloaded_media" media_folder="$rdhome/downloaded_media"
themes_folder="$rdhome/themes" themes_folder="$rdhome/themes"
emulator_post_move emulators_post_move
conf_write conf_write
configurator_process_complete_dialog "moving the RetroDECK data directory to internal storage" configurator_process_complete_dialog "moving the RetroDECK data directory to internal storage"
@ -380,8 +379,8 @@ configurator_move_dialog() {
;; ;;
"SD Card" ) "SD Card" )
if [[ -L $rdhome && -d $sdcard/retrodeck ]]; then if [[ -L "$HOME/retrodeck" && -d $sdcard/retrodeck && "$rdhome" == "$sdcard/retrodeck" ]]; then
configurator_generic_dialog "The RetroDECK data folder is already at that location, please pick a new one." configurator_generic_dialog "The RetroDECK data folder is already configured to that location, please pick a new one."
configurator_move_dialog configurator_move_dialog
else else
if [[ ! -w $sdcard ]]; then if [[ ! -w $sdcard ]]; then
@ -390,12 +389,12 @@ configurator_move_dialog() {
else else
if [[ $(verify_space $rdhome $sdcard) == "true" ]];then if [[ $(verify_space $rdhome $sdcard) == "true" ]];then
configurator_generic_dialog "Moving RetroDECK data folder to $destination" configurator_generic_dialog "Moving RetroDECK data folder to $destination"
if [[ -L $rdhome/roms ]]; then # Check for ROMs symlink user may have created if [[ -L "$HOME/retrodeck/roms" ]]; then # Check for ROMs symlink user may have created
unlink $rdhome/roms unlink "$HOME/retrodeck/roms"
fi fi
( (
dir_prep "$sdcard/retrodeck" $rdhome dir_prep "$sdcard/retrodeck" "$rdhome"
) | ) |
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" \
@ -409,7 +408,7 @@ configurator_move_dialog() {
bios_folder="$rdhome/bios" bios_folder="$rdhome/bios"
media_folder="$rdhome/downloaded_media" media_folder="$rdhome/downloaded_media"
themes_folder="$rdhome/themes" themes_folder="$rdhome/themes"
emulator_post_move emulators_post_move
conf_write conf_write
configurator_process_complete_dialog "moving the RetroDECK data directory to SD card" configurator_process_complete_dialog "moving the RetroDECK data directory to SD card"
else else
@ -436,7 +435,7 @@ configurator_move_dialog() {
fi fi
( (
dir_prep "$custom_dest/retrodeck" $rdhome dir_prep "$custom_dest/retrodeck" "$rdhome"
) | ) |
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" \
@ -450,7 +449,7 @@ configurator_move_dialog() {
bios_folder="$rdhome/bios" bios_folder="$rdhome/bios"
media_folder="$rdhome/downloaded_media" media_folder="$rdhome/downloaded_media"
themes_folder="$rdhome/themes" themes_folder="$rdhome/themes"
emulator_post_move emulators_post_move
conf_write conf_write
configurator_process_complete_dialog "moving the RetroDECK data directory to SD card" configurator_process_complete_dialog "moving the RetroDECK data directory to SD card"
else else
@ -498,6 +497,7 @@ configurator_welcome_dialog() {
case $choice in case $choice in
"Move Files" ) "Move Files" )
configurator_generic_dialog "This option will move the RetroDECK data folder (ROMs, saves, BIOS etc.) to a new location.\n\nPlease choose where to move the RetroDECK data folder."
configurator_move_dialog configurator_move_dialog
;; ;;