Skip to content

Commit 3187878

Browse files
committed
Fix path ordering
1 parent cf64c25 commit 3187878

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

paths

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,11 @@ paths=(
2727
"$HOME/.rd/bin" # Rancher
2828
)
2929

30+
new_path=""
3031
for search_path in "${paths[@]}"; do
3132
[[ -d $search_path ]] \
32-
&& [[ ":$PATH:" != *":$search_path:"* ]] \
33-
&& PATH=$search_path:$PATH
33+
&& [[ ":$new_path:" != *":$search_path:"* ]] \
34+
&& new_path="${new_path:+$new_path:}$search_path"
3435
done
3536

36-
export PATH
37+
export PATH="$new_path"

0 commit comments

Comments
 (0)