File tree Expand file tree Collapse file tree 3 files changed +18
-10
lines changed
Expand file tree Collapse file tree 3 files changed +18
-10
lines changed Original file line number Diff line number Diff line change @@ -27,11 +27,7 @@ for version in "${versions[@]}"; do
2727 exit 127
2828 fi
2929
30- # custom plugin hook for executable path
31- if [ -f " ${plugin_path} /bin/exec-path" ]; then
32- cmd=$( basename " $executable_path " )
33- executable_path=" $( " ${plugin_path} /bin/exec-path" " $install_path " " $cmd " " $executable_path " ) "
34- fi
30+ executable_path=$( get_custom_executable_path " $plugin_path " " $install_path " " $executable_path " )
3531
3632 if full_executable_path=$( get_executable_path " $plugin_name " " $version " " $executable_path " ) ; then
3733 if [ -f " $full_executable_path " ]; then
Original file line number Diff line number Diff line change @@ -12,13 +12,11 @@ which_command() {
1212 if [ " $version " = " system" ]; then
1313 continue
1414 fi
15- if [ -f " ${plugin_path} /bin/exec-path" ]; then
16- cmd=$( basename " $executable_path " )
17- install_path=$( find_install_path " $plugin_name " " $version " )
18- executable_path=" $( " ${plugin_path} /bin/exec-path" " $install_path " " $cmd " " $executable_path " ) "
19- fi
15+
16+ executable_path=" $( get_custom_executable_path " $plugin_path " " $install_path " " $executable_path " ) "
2017 full_executable_path=$( get_executable_path " $plugin_name " " $version " " $executable_path " )
2118 location=$( find -L " $full_executable_path " -maxdepth 4 -name " $command " -type f -perm -u+x | sed -e ' s|//|/|g' )
19+
2220 if [ -n " $location " ]; then
2321 echo " $location "
2422 not_found=0
Original file line number Diff line number Diff line change @@ -220,6 +220,20 @@ find_install_path() {
220220 fi
221221}
222222
223+ get_custom_executable_path () {
224+ local plugin_path=$1
225+ local install_path=$2
226+ local executable_path=$3
227+
228+ # custom plugin hook for executable path
229+ if [ -f " ${plugin_path} /bin/exec-path" ]; then
230+ cmd=$( basename " $executable_path " )
231+ executable_path=" $( " ${plugin_path} /bin/exec-path" " $install_path " " $cmd " " $executable_path " ) "
232+ fi
233+
234+ echo $executable_path
235+ }
236+
223237get_executable_path () {
224238 local plugin_name=$1
225239 local version=$2
You can’t perform that action at this time.
0 commit comments