mirror of
https://github.com/oh-my-fish/oh-my-fish
synced 2024-11-03 15:40:32 +00:00
20 lines
414 B
Fish
20 lines
414 B
Fish
# Appends the path to the specified path list. If no list specified,
|
|
# defaults to $PATH
|
|
function _append_path
|
|
set_color red
|
|
echo '_append_path function deprecated. Rename to _prepend_path.' >&2
|
|
set_color normal
|
|
|
|
set -l path PATH
|
|
|
|
if test (echo $argv | wc -w) -eq 2
|
|
set path $argv[2]
|
|
end
|
|
|
|
if test -d $argv[1]
|
|
if not contains $argv[1] $$path
|
|
set $path $argv[1] $$path
|
|
end
|
|
end
|
|
end
|