Fix TOML parser comment handling and variable expansion issues

This commit is contained in:
robojerk 2025-06-25 16:01:56 -07:00
parent 9c70e75c78
commit 3c3e280c9d
2 changed files with 16 additions and 9 deletions

View file

@ -47,6 +47,13 @@ parse_toml() {
# Remove quotes from value
value=$(echo "$value" | sed 's/^"\(.*\)"$/\1/' | sed "s/^'\(.*\)'$/\1/")
# Remove inline comments (everything after #)
value=$(echo "$value" | sed 's/[[:space:]]*#.*$//')
# Trim whitespace
key=$(echo "$key" | xargs)
value=$(echo "$value" | xargs)
# Convert to environment variable format
if [ -n "$current_section" ]; then
if [[ "$current_section" == "global" ]]; then