@@ -259,7 +259,7 @@ declare _GO_INJECT_MODULE_PATH="$_GO_INJECT_MODULE_PATH"
259259 return 1
260260 fi
261261
262- if [[ " $__go_cmd_path " =~ ^ $_GO_PLUGINS_DIR / ]]; then
262+ if [[ " ${ __go_cmd_path# $_GO_SCRIPTS_DIR } " =~ /plugins / ]]; then
263263 _@go.run_plugin_command_script " $__go_cmd_path " " ${__go_argv[@]} "
264264 else
265265 _@go.run_command_script " $__go_cmd_path " " ${__go_argv[@]} "
@@ -273,26 +273,10 @@ _@go.source_builtin() {
273273}
274274
275275_@go.run_plugin_command_script () {
276- local _GO_SCRIPTS_DIR=" ${__go_cmd_path%/* } "
276+ local _GO_SCRIPTS_DIR=" ${__go_cmd_path%/ bin /* } /bin "
277277 local _GO_ROOTDIR=" ${_GO_SCRIPTS_DIR%/* } "
278- local _GO_SEARCH_PATHS=()
279278 local _GO_PLUGINS_PATHS=()
280- local plugins_dir=" $_GO_SCRIPTS_DIR /plugins"
281- local plugin_paths=()
282-
283- # A plugin's own local plugin paths will appear before inherited ones. If
284- # there is a version incompatibility issue with other installed plugins, this
285- # allows a plugin's preferred version to take precedence.
286- while true ; do
287- plugin_paths=(" $plugins_dir " /* /bin)
288- if [[ " ${plugin_paths[0]} " != " $plugins_dir /*/bin" ]]; then
289- _GO_PLUGINS_PATHS+=(" ${plugin_paths[@]} " )
290- fi
291- if [[ " $plugins_dir " == " $_GO_PLUGINS_DIR " ]]; then
292- break
293- fi
294- plugins_dir=" ${plugins_dir%/ plugins/* } /plugins"
295- done
279+ local _GO_SEARCH_PATHS=()
296280
297281 _@go.set_search_paths
298282 _@go.run_command_script " $__go_cmd_path " " ${__go_argv[@]} "
0 commit comments