mirror of
https://github.com/ViViDboarder/shoestrap.git
synced 2024-12-22 17:57:40 +00:00
Add some more handy fish funcs
This commit is contained in:
parent
8a7f1516fb
commit
48de40cf42
11
assets/default/fish/functions/npm_activate.fish
Executable file
11
assets/default/fish/functions/npm_activate.fish
Executable 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
|
14
assets/default/fish/functions/ssh-add-all.fish
Executable file
14
assets/default/fish/functions/ssh-add-all.fish
Executable 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
|
Loading…
Reference in New Issue
Block a user