Skip to content

Commit

Permalink
Merge branch 'systemmonkey42-issue_1120'
Browse files Browse the repository at this point in the history
  • Loading branch information
Stratus3D committed Jan 27, 2022
2 parents 06d469e + b2b71e6 commit 2a538fe
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/utils.bash
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions test/get_asdf_config_value.bats
Expand Up @@ -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" ]
}

0 comments on commit 2a538fe

Please sign in to comment.