37
37
38
38
# First order of business, see whether we can setup asdf
39
39
echo " Looking for asdf install" >&2
40
- ASDF_DIR=${ASDF_DIR:- " ${HOME} /.asdf" }
41
40
42
41
# Check if we have the asdf binary for version >= 0.16.0
43
42
if command -v asdf > /dev/null 2>&1 ; then
@@ -47,6 +46,7 @@ if command -v asdf >/dev/null 2>&1; then
47
46
minor=$( echo " $version " | cut -d. -f2)
48
47
# If the version is less than 0.16.0 (i.e. major = 0 and minor < 16), use legacy method.
49
48
if [ " $major " -eq 0 ] && [ " $minor " -lt 16 ]; then
49
+ ASDF_DIR=${ASDF_DIR:- " ${HOME} /.asdf" }
50
50
ASDF_SH=" ${ASDF_DIR} /asdf.sh"
51
51
if test -f " $ASDF_SH " ; then
52
52
>&2 echo " Legacy pre v0.16.0 asdf install found at $ASDF_SH , sourcing"
@@ -56,13 +56,11 @@ if command -v asdf >/dev/null 2>&1; then
56
56
>&2 echo " Legacy asdf not found at $ASDF_SH "
57
57
fi
58
58
else
59
- >&2 echo " asdf executable found at $( command -v asdf) . Setting ASDF_DIR=${ASDF_DIR} and adding ${ASDF_DIR} /shims to PATH."
60
- # If the binary is found, set up environment for newer asdf versions
61
- export ASDF_DATA_DIR=" $ASDF_DIR "
62
- export PATH=" $ASDF_DATA_DIR /shims:$PATH "
59
+ >&2 echo " asdf executable found at $( command -v asdf) . Using ASDF_DIR=${ASDF_DIR} , ASDF_DATA_DIR=${ASDF_DATA_DIR} ."
63
60
fi
64
61
else
65
62
# Fallback to old method for version <= 0.15.x
63
+ ASDF_DIR=${ASDF_DIR:- " ${HOME} /.asdf" }
66
64
ASDF_SH=" ${ASDF_DIR} /asdf.sh"
67
65
if test -f " $ASDF_SH " ; then
68
66
>&2 echo " Legacy pre v0.16.0 asdf install found at $ASDF_SH , sourcing"
0 commit comments