Skip to content

Commit 20522bb

Browse files
committed
Correct bug in path logic that added current directory to PATH
1 parent 549d86e commit 20522bb

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/utils.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -499,8 +499,12 @@ with_plugin_env() {
499499
plugin_path=$(get_plugin_path "$plugin_name")
500500

501501
# add the plugin listed exec paths to PATH
502-
local path
503-
path="$(list_plugin_exec_paths "$plugin_name" "$full_version" | tr '\n' ':'):$PATH"
502+
local path exec_paths
503+
exec_paths="$(list_plugin_exec_paths "$plugin_name" "$full_version")"
504+
505+
# exec_paths contains a trailing newline which is converted to a colon, so no
506+
# colon is needed between the subshell and the PATH variable in this string
507+
path="$(echo "$exec_paths" | tr '\n' ':')$PATH"
504508

505509
# If no custom exec-env transform, just execute callback
506510
if [ ! -f "${plugin_path}/bin/exec-env" ]; then

0 commit comments

Comments
 (0)