Add some more handy fish funcs

This commit is contained in:
ViViDboarder 2019-04-11 13:23:45 -07:00
parent 8a7f1516fb
commit 48de40cf42
2 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1,11 @@
function npm_activate
set -gx OLD_PATH $PATH
set -gx PATH (npm bin) $PATH
end
function npm_deactivate
if [ "$OLD_PATH" != "" ]
set -gx PATH $OLD_PATH
set -e OLD_PATH
end
end

View File

@ -0,0 +1,14 @@
# Adds all private keys to ssh agent
# Adds a key to agent if it hasn't been added yet
function __maybe_ssh_add
for key in $argv
if grep -q 'PRIVATE KEY' $key
ssh-add -l | grep -q "$key" ;or ssh-add $key
end
end
end
function ssh-add-all
__maybe_ssh_add $HOME/.ssh/id_rsa_*
end