Build works for sure in FreeBSD now, upload may have a problem still
Some checks failed
CI / Test (Linux) (push) Has been cancelled
CI / Test (Windows MSVC) (push) Has been cancelled
CI / Clippy (push) Has been cancelled
CI / Format (push) Has been cancelled

This commit is contained in:
Eric Ratliff
2026-03-15 17:32:04 -05:00
parent 79f6bb57d4
commit fedb304b7c
2 changed files with 46 additions and 4 deletions

View File

@@ -39,8 +39,29 @@ toml_get() {
}
toml_array() {
(grep "^$1 " "$CONFIG" 2>/dev/null || true) | head -1 \
| sed 's/.*\[//; s/\].*//; s/"//g; s/,/ /g' | tr -s ' '
# Handles both single-line: key = ["a", "b"]
# and multiline: key = [
# "a",
# "b",
# ]
awk -v key="$1" '
$0 ~ ("^" key " *= *\\[") {
collecting = 1
buf = $0
if (index($0, "]") > 0) { collecting = 0 }
}
collecting && NR > 1 { buf = buf " " $0 }
collecting && index($0, "]") > 0 && NR > 1 { collecting = 0 }
!collecting && buf != "" {
gsub(/.*\[/, "", buf)
gsub(/\].*/, "", buf)
gsub(/"/, "", buf)
gsub(/,/, " ", buf)
print buf
buf = ""
exit
}
' "$CONFIG" | tr -s " "
}
toml_section_get() {