add(fish): use builtin function

read more: `https://github.com/fish-shell/fish-shell/issues/8604`
This commit is contained in:
Léana 江 2023-11-20 18:42:40 +01:00 committed by Léana 江
parent 4aeaee18d2
commit 84bd7caa18
3 changed files with 5 additions and 18 deletions

View file

@ -1,5 +0,0 @@
function add_paths --description "add to PATH idempotently"
contains -- $argv $fish_user_paths
or set --universal fish_user_paths $fish_user_paths $argv
echo "Updated PATH: $PATH"
end

View file

@ -1,8 +0,0 @@
function remove_path
if set index (contains -i $argv[1] $PATH)
set --erase --universal fish_user_paths[$index]
echo "Updated PATH: $PATH"
else
echo "$argv[1] not found in PATH: $PATH"
end
end