Skip to content

Commit

Permalink
fix: get invalid ASDF_DATA_DIR when exec asdf shims by non-shell (#1154)
Browse files Browse the repository at this point in the history
* fix: get invalid ASDF_DATA_DIR when exec asdf shims by non-shell

asdf_data_dir function inits ASDF_DATA_DIR with HOME when value is empty.
HOME may replace to empty string when asdf shims called by non-shell program.
this makes invalid value of ASDF_DATA_DIR.
  • Loading branch information
knokmki612 committed Jun 8, 2022
1 parent 92d005d commit b9962f7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/utils.bash
Expand Up @@ -41,8 +41,10 @@ asdf_data_dir() {

if [ -n "${ASDF_DATA_DIR}" ]; then
data_dir="${ASDF_DATA_DIR}"
else
elif [ -n "$HOME" ]; then
data_dir="$HOME/.asdf"
else
data_dir=$(asdf_dir)
fi

printf "%s\\n" "$data_dir"
Expand Down

0 comments on commit b9962f7

Please sign in to comment.