Merge branch 'systemmonkey42-issue_1120'

This commit is contained in:
Trevor Brown 2022-01-27 11:20:46 -05:00
commit 2a538fe631
2 changed files with 9 additions and 1 deletions

View File

@ -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

View File

@ -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" ]
}