mirror of
https://github.com/asdf-vm/asdf.git
synced 2024-11-15 01:28:17 -07:00
Merge branch 'systemmonkey42-issue_1120'
This commit is contained in:
commit
2a538fe631
@ -357,7 +357,7 @@ get_asdf_config_value_from_file() {
|
||||
fi
|
||||
|
||||
local result
|
||||
result=$(grep -E "^\\s*$key\\s*=\\s*" "$config_path" | head | awk -F '=' '{print $2}' | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
|
||||
result=$(grep -E "^\\s*$key\\s*=\\s*" "$config_path" | head | sed -e 's/^[^=]*= *//' -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
|
||||
if [ -n "$result" ]; then
|
||||
printf "%s\\n" "$result"
|
||||
return 0
|
||||
|
@ -38,3 +38,11 @@ teardown() {
|
||||
[ $(get_asdf_config_value "key1") = "value1" ]
|
||||
[ $(get_asdf_config_value "legacy_version_file") = "yes" ]
|
||||
}
|
||||
|
||||
@test "get_config returns config file complete value including '=' symbols" {
|
||||
cat >> $ASDF_CONFIG_FILE <<-'EOM'
|
||||
key3 = VAR=val
|
||||
EOM
|
||||
|
||||
[ $(get_asdf_config_value "key3") = "VAR=val" ]
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user