Add some more handy fish funcs
This commit is contained in:
parent
8a7f1516fb
commit
48de40cf42
|
@ -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
|
|
@ -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
|
Loading…
Reference in New Issue