Skip to content

Commit a44ec27

Browse files
committed
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
1 parent 7e5789a commit a44ec27

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/utils.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ parse_legacy_version_file() {
243243
get_preset_version_for() {
244244
local plugin_name=$1
245245
local search_path
246-
search_path=$(pwd)
246+
search_path=$(realpath "$(pwd)")
247247
local version_and_path
248248
version_and_path=$(find_version "$plugin_name" "$search_path")
249249
local version

0 commit comments

Comments
 (0)