hazelweakly, Writing me the good code todayyy
Set all variables to their known defaults if they aren't already set
set_if_unset() {
key=$1
current_value="${!key}"
array_value="${base_variable_defaults["$key"]-${derived_variable_defaults["$key"]}}"
if [[ $current_value =~ "WARNING: UNSET" ]]; then
printf -v "$key" -- "$array_value"
fi
}
Add comment