FRAMEWORK: migrating update_rd_conf into a reworked function with features.json support

This commit is contained in:
XargonWan 2024-08-07 16:20:27 +09:00
parent af724a6977
commit 07b8edb32e

View file

@ -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