[F] Use correct awk logic for toml vs yml

I have no idea how, but I had the awk logic reversed.

Signed-off-by: Bailey Kasin <baileykasin@gmail.com>
This commit is contained in:
Bailey Kasin 2023-10-21 23:18:37 -07:00
parent d267aaa90c
commit 42a275b27b
No known key found for this signature in database
GPG key ID: 652DB3E919FED665

View file

@ -4435,12 +4435,12 @@ get_term_font() {
shopt -u nullglob
if [[ -f "${confs_toml[0]}" ]]; then
term_font="$(awk '/normal:/ {while (!/family:/ || /#/)
{if (!getline) {exit}} print; exit}' "${confs_toml[0]}")"
elif [[ -f "${confs_yaml[0]}" ]]; then
term_font="$(awk -F' *= *' '/^\[.*\]$/{section=substr($0, 2, length-2)}
section == "font.normal" && $1 == "family"{sub(/^"/,"", $2);
sub(/"$/, "", $2); print $2}' "${confs_yaml[0]}")"
sub(/"$/, "", $2); print $2}' "${confs_toml[0]}")"
elif [[ -f "${confs_yaml[0]}" ]]; then
term_font="$(awk '/normal:/ {while (!/family:/ || /#/)
{if (!getline) {exit}} print; exit}' "${confs_yaml[0]}")"
else
return
fi