Fix TOML parser comment handling and variable expansion issues
This commit is contained in:
parent
9c70e75c78
commit
3c3e280c9d
2 changed files with 16 additions and 9 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue