mirror of
https://github.com/RetroDECK/RetroDECK.git
synced 2024-11-24 23:15:39 +00:00
FRAMEWORK: migrating update_rd_conf into a reworked function with features.json support
This commit is contained in:
parent
af724a6977
commit
07b8edb32e
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue