mirror of
https://github.com/oh-my-fish/oh-my-fish.git
synced 2024-11-28 03:09:31 +08:00
239beda7ea
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.
16 lines
306 B
Fish
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
|