mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-22 13:18:59 +08:00
Support /etc/paths and /etc/paths.d/* on OS X
https://github.com/fish-shell/fish-shell/issues/417
This commit is contained in:
parent
9f8fe3d5e3
commit
d99c2cb9a7
|
@ -79,6 +79,19 @@ function __fish_reconstruct_path -d "Update PATH when fish_user_paths changes" -
|
|||
end
|
||||
__fish_reconstruct_path
|
||||
|
||||
# OS X-ism: Load the path files out of /etc/paths and /etc/paths.d/*
|
||||
function __fish_load_path_helper_paths
|
||||
while read -l new_path_comp
|
||||
if not contains $new_path_comp $PATH
|
||||
set PATH $PATH $new_path_comp
|
||||
end
|
||||
end
|
||||
end
|
||||
if test -r /etc/paths ; __fish_load_path_helper_paths < /etc/paths ; end
|
||||
for pathfile in /etc/paths.d/* ; __fish_load_path_helper_paths < $pathfile ; end
|
||||
functions -e __fish_load_path_helper_paths
|
||||
|
||||
|
||||
#
|
||||
# Launch debugger on SIGTRAP
|
||||
#
|
||||
|
|
Loading…
Reference in New Issue
Block a user