Fix edge case when looking for .asdf-version

cwd can potentially be a symlink, which breaks asdf logic.
The following command will fail to resolve the path correctly:

    env - PWD=/proc/self/cwd PATH=$HOME/.asdf/shims:/bin ruby --version

This first resolves the real path of cwd before continuing to search
for a .tool-versions file
This commit is contained in:
Daniel Perez 2017-10-25 19:51:13 +09:00
parent 7e5789adb7
commit a44ec2779a

View File

@ -243,7 +243,7 @@ parse_legacy_version_file() {
get_preset_version_for() {
local plugin_name=$1
local search_path
search_path=$(pwd)
search_path=$(realpath "$(pwd)")
local version_and_path
version_and_path=$(find_version "$plugin_name" "$search_path")
local version