aboutsummaryrefslogtreecommitdiffhomepage
path: root/share
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2013-08-25 14:00:56 -0700
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2013-08-25 14:02:03 -0700
commit9f46881c16af03b52b9daba7c645100f180b7a8f (patch)
tree063c500da0fe52946c94bbbf6eb0ec230aa6011a /share
parentdead45fa67773324ec136acc37184e40af3cfe9f (diff)
Fix to respect the order of paths in /etc/paths (oops)
Diffstat (limited to 'share')
-rw-r--r--share/config.fish7
1 files changed, 5 insertions, 2 deletions
diff --git a/share/config.fish b/share/config.fish
index e7ca703f..6b62a01c 100644
--- a/share/config.fish
+++ b/share/config.fish
@@ -60,12 +60,15 @@ end
# OS X-ism: Load the path files out of /etc/paths and /etc/paths.d/*
set -g __fish_tmp_path $PATH
function __fish_load_path_helper_paths
+ # We want to rearrange the path to reflect this order. Delete that path component if it exists and then prepend it.
+ # Since we are prepending but want to preserve the order of the input file, we reverse the array, append, and then reverse it again
+ set __fish_tmp_path $__fish_tmp_path[-1..1]
while read -l new_path_comp
- # We want to rearrange the path to reflect this order. Delete that path component if it exists and then prepend it.
- set -l where (contains -i $new_path_comp $__fish_tmp_path)
+ set -l where (contains -i $new_path_comp $__fish_tmp_path)
and set -e __fish_tmp_path[$where]
set __fish_tmp_path $new_path_comp $__fish_tmp_path
end
+ set __fish_tmp_path $__fish_tmp_path[-1..1]
end
test -r /etc/paths ; and __fish_load_path_helper_paths < /etc/paths
for pathfile in /etc/paths.d/* ; __fish_load_path_helper_paths < $pathfile ; end