oh-my-fish/functions/_append_path.fish
Fission Xuiptz 239beda7ea Fixed condition check on item existence in list
Previously, 'set $path...' ran regardless of the result of 'and not contains...'. This fixes _append_path to actually use the result of the condition check.
2014-04-24 16:50:37 -03:00

16 lines
306 B
Fish

# 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
end
end