Skip adding ssh keys when ~/.ssh does not exist

master
Jordan Atwood 2 years ago
parent 77404ee964
commit 514bb1a1c8
Signed by: nightfirecat
GPG Key ID: 615A619C2D73A6DF
  1. 4
      src/.bashrc

@ -134,6 +134,10 @@ alias la='ll -A'
# only performs `ssh-add` on files in ~/.ssh/ which have a header indicating
# they are SSH keys, and which are not loaded in the agent
function _bashrc_ssh-add-keys {
if ! [ -d ~/.ssh ]; then
return
fi
if ! grep -E -q -- '-BEGIN (OPENSSH|RSA) PRIVATE KEY-' ~/.ssh/*; then
return
fi

Loading…
Cancel
Save