2013-11-03 18:47:32 +00:00
|
|
|
# Appends the path to the specified path list. If no list specified,
|
|
|
|
# defaults to $PATH
|
|
|
|
function _append_path
|
2014-11-29 06:15:30 +00:00
|
|
|
set_color red
|
2014-12-23 18:42:00 +00:00
|
|
|
echo '_append_path function deprecated. Rename to _prepend_path.' >&2
|
2014-11-29 06:15:30 +00:00
|
|
|
set_color normal
|
|
|
|
|
2013-11-03 18:47:32 +00:00
|
|
|
set -l path PATH
|
|
|
|
|
|
|
|
if test (echo $argv | wc -w) -eq 2
|
|
|
|
set path $argv[2]
|
|
|
|
end
|
|
|
|
|
2014-04-23 02:17:55 +00:00
|
|
|
if test -d $argv[1]
|
|
|
|
if not contains $argv[1] $$path
|
|
|
|
set $path $argv[1] $$path
|
|
|
|
end
|
2013-11-03 18:47:32 +00:00
|
|
|
end
|
|
|
|
end
|