From 85f5871964151894b1c0b79575f0544585b6f53b Mon Sep 17 00:00:00 2001 From: icenine451 Date: Mon, 29 Jul 2024 08:48:58 -0400 Subject: [PATCH] Update retrodeck prepare_component to accomodate subfolders in retrodeck.cfg paths --- functions/prepare_component.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/functions/prepare_component.sh b/functions/prepare_component.sh index 306389f2..c540de97 100644 --- a/functions/prepare_component.sh +++ b/functions/prepare_component.sh @@ -26,7 +26,7 @@ prepare_component() { declare -g "$current_setting_name=$rdhome/${current_setting_value#*retrodeck/}" #removes everything until "retrodeck" and adds the actual retrodeck folder log d "Setting: $current_setting_name=$current_setting_value" if [[ ! $current_setting_name == "logs_folder" ]]; then # Don't create a logs folder normally, we want to maintain the current files exactly to not lose early-install logs. - create_dir "$rdhome/$(basename $current_setting_value)" + create_dir "$rdhome/${current_setting_value#*retrodeck/}" else # Log folder-specific actions mv "$rd_logs_folder" "$logs_folder" # Move existing logs folder from internal to userland ln -sf "$logs_folder" "$rd_logs_folder" # Link userland logs folder back to statically-written location @@ -42,8 +42,8 @@ prepare_component() { local current_setting_name=$(get_setting_name "$config_line" "retrodeck") if [[ ! $current_setting_name =~ (rdhome|sdcard) ]]; then # Ignore these locations local current_setting_value=$(get_setting_value "$rd_conf" "$current_setting_name" "retrodeck" "paths") - if [[ -d "$rdhome/$(basename $current_setting_value)" ]]; then # If the folder exists at the new ~/retrodeck location - declare -g "$current_setting_name=$rdhome/$(basename $current_setting_value)" + if [[ -d "$rdhome/${current_setting_value#*retrodeck/}" ]]; then # If the folder exists at the new ~/retrodeck location + declare -g "$current_setting_name=$rdhome/${current_setting_value#*retrodeck/}" fi fi done < <(grep -v '^\s*$' $rd_conf | awk '/^\[paths\]/{f=1;next} /^\[/{f=0} f')