mirror of
https://github.com/oh-my-fish/oh-my-fish.git
synced 2025-01-23 10:07:31 +08:00
15 lines
305 B
Fish
15 lines
305 B
Fish
# Prepends the path to the specified path list. If no list specified, defaults to $PATH
|
|
function _prepend_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
|