mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-25 12:23:09 +00:00
Keep the order for $PATH and $MANPATH when reading /etc/paths (#5767)
* Keep the order for $PATH and $MANPATH when reading /etc/paths Fixes #5456.
This commit is contained in:
parent
0aa0dceeb3
commit
7aaa3b8553
1 changed files with 3 additions and 7 deletions
|
@ -173,7 +173,9 @@ if status --is-login
|
|||
# executable for fish; see
|
||||
# https://opensource.apple.com/source/shell_cmds/shell_cmds-203/path_helper/path_helper.c.auto.html .
|
||||
function __fish_macos_set_env -d "set an environment variable like path_helper does (macOS only)"
|
||||
set -l result
|
||||
# The first argument is the variable name, the others are the files.
|
||||
# Keep the components already there so we don't change the order
|
||||
set -l result $$argv[1]
|
||||
|
||||
for path_file in $argv[2] $argv[3]/*
|
||||
if [ -f $path_file ]
|
||||
|
@ -185,12 +187,6 @@ if status --is-login
|
|||
end
|
||||
end
|
||||
|
||||
for entry in $$argv[1]
|
||||
if not contains -- $entry $result
|
||||
set result $result $entry
|
||||
end
|
||||
end
|
||||
|
||||
set -xg $argv[1] $result
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue