oh-my-fish/functions/_append_path.fish

16 lines
306 B
Fish
Raw Normal View History

2013-11-04 02:47:32 +08:00
# Appends the path to the specified path list. If no list specified,
# defaults to $PATH
function _append_path
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
2013-11-04 02:47:32 +08:00
end
end