mirror of
https://github.com/RetroDECK/RetroDECK.git
synced 2024-11-28 16:45:42 +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
|
# 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
|
while IFS= read -r current_setting_line # Read the existing retrodeck.cfg
|
||||||
do
|
do
|
||||||
if [[ (! -z "$current_setting_line") && (! "$current_setting_line" == "#"*) && (! "$current_setting_line" == "[]") ]]; then # If the line has a valid entry in it
|
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"
|
set_setting_value "$rd_conf" "$system_name" "false" "retrodeck" "$current_section"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done < "$incompatible_presets_reference_list"
|
done <<< "$incompatible_presets"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
@ -187,6 +196,7 @@ update_rd_conf() {
|
||||||
done < $rd_conf
|
done < $rd_conf
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
conf_read() {
|
conf_read() {
|
||||||
# This function will read the RetroDECK config file into memory
|
# This function will read the RetroDECK config file into memory
|
||||||
# USAGE: conf_read
|
# USAGE: conf_read
|
||||||
|
|
Loading…
Reference in a new issue