diff --git a/functions/other_functions.sh b/functions/other_functions.sh index 5786f8cf..adaa56e5 100644 --- a/functions/other_functions.sh +++ b/functions/other_functions.sh @@ -162,6 +162,15 @@ update_rd_conf() { # STAGE 3: Eliminate any preset incompatibility with existing user settings and new defaults + # Fetch incompatible presets from JSON and create a lookup list + incompatible_presets=$(jq -r ' + .incompatible_presets | to_entries[] | + [ + "\(.key):\(.value)", + "\(.value):\(.key)" + ] | join("\n") + ' config/retrodeck/reference_lists/features.json) + while IFS= read -r current_setting_line # Read the existing retrodeck.cfg do if [[ (! -z "$current_setting_line") && (! "$current_setting_line" == "#"*) && (! "$current_setting_line" == "[]") ]]; then # If the line has a valid entry in it @@ -179,7 +188,7 @@ update_rd_conf() { set_setting_value "$rd_conf" "$system_name" "false" "retrodeck" "$current_section" fi fi - done < "$incompatible_presets_reference_list" + done <<< "$incompatible_presets" fi fi fi @@ -187,6 +196,7 @@ update_rd_conf() { done < $rd_conf } + conf_read() { # This function will read the RetroDECK config file into memory # USAGE: conf_read