@@ -15,50 +15,53 @@ if [ "$full_version" == "" ]; then
1515 exit -1
1616fi
1717
18+ IFS=' ' read -a versions <<< " $full_version"
1819
19- IFS=' :' read -a version_info <<< " $full_version"
20- if [ " ${version_info[0]} " = " ref" ]; then
21- install_type=" ${version_info[0]} "
22- version=" ${version_info[1]} "
23- install_path=$( get_install_path $plugin_name $install_type $version )
24- elif [ " ${version_info[0]} " = " path" ]; then
25- # This is for people who have the local source already compiled
26- # Like those who work on the language, etc
27- # We'll allow specifying path:/foo/bar/project in .tool-versions
28- # And then use the binaries there
29- install_type=" path"
30- version=" path"
31- install_path=" ${version_info[1]} "
32- else
33- install_type=" version"
34- version=" ${version_info[0]} "
35- install_path=$( get_install_path $plugin_name $install_type $version )
36- fi
20+ for version in " ${versions[@]} " ; do
21+ IFS=' :' read -a version_info <<< " $version"
3722
23+ if [ " ${version_info[0]} " = " ref" ]; then
24+ install_type=" ${version_info[0]} "
25+ version=" ${version_info[1]} "
26+ install_path=$( get_install_path $plugin_name $install_type $version )
27+ elif [ " ${version_info[0]} " = " path" ]; then
28+ # This is for people who have the local source already compiled
29+ # Like those who work on the language, etc
30+ # We'll allow specifying path:/foo/bar/project in .tool-versions
31+ # And then use the binaries there
32+ install_type=" path"
33+ version=" path"
34+ install_path=" ${version_info[1]} "
35+ else
36+ install_type=" version"
37+ version=" ${version_info[0]} "
38+ install_path=$( get_install_path $plugin_name $install_type $version )
39+ fi
3840
39- if [ ! -d $install_path ]; then
40- echo " $plugin_name $full_version not installed"
41- exit 1
42- fi
4341
44- if [ ! -f ${ install_path} / ${executable_path} ]; then
45- echo " No such command in $full_version of $plugin_name "
46- exit 1
47- fi
42+ if [ ! -d $ install_path ]; then
43+ echo " $plugin_name $version not installed "
44+ exit 1
45+ fi
4846
47+ if [ -f ${install_path} /${executable_path} ]; then
48+ if [ -f ${plugin_path} /bin/exec-env ]; then
49+ export ASDF_INSTALL_TYPE=$install_type
50+ export ASDF_INSTALL_VERSION=$version
51+ export ASDF_INSTALL_PATH=$install_path
4952
50- if [ -f ${plugin_path} /bin/exec-env ]; then
51- export ASDF_INSTALL_TYPE=$install_type
52- export ASDF_INSTALL_VERSION=$version
53- export ASDF_INSTALL_PATH=$install_path
53+ source ${plugin_path} /bin/exec-env
5454
55- source ${plugin_path} /bin/exec-env
55+ # unset everything, we don't want to pollute
56+ unset ASDF_INSTALL_TYPE
57+ unset ASDF_INSTALL_VERSION
58+ unset ASDF_INSTALL_PATH
59+ exec ${install_path} /${executable_path} " ${@: 3} "
60+ else
61+ exec ${install_path} /${executable_path} " ${@: 3} "
62+ fi
63+ fi
64+ done
5665
57- # unset everything, we don't want to pollute
58- unset ASDF_INSTALL_TYPE
59- unset ASDF_INSTALL_VERSION
60- unset ASDF_INSTALL_PATH
61- exec ${install_path} /${executable_path} " ${@: 3} "
62- else
63- exec ${install_path} /${executable_path} " ${@: 3} "
64- fi
66+ echo " No such command in $full_version of $plugin_name "
67+ exit 1
0 commit comments