fix(ssh-agent): add error message if ~/.ssh is not found (#11929)

Closes #11829 

Co-authored-by: Carlo Sala <carlosalag@protonmail.com>
This commit is contained in:
Vishal Sharma 2023-10-18 23:44:47 +05:30 committed by GitHub
parent 8152dc673b
commit 0da416986a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -13,6 +13,11 @@ function _start_agent() {
fi fi
fi fi
if [[ ! -d "$HOME/.ssh" ]]; then
echo "[oh-my-zsh] ssh-agent plugin requires ~/.ssh directory"
return 1
fi
# Set a maximum lifetime for identities added to ssh-agent # Set a maximum lifetime for identities added to ssh-agent
local lifetime local lifetime
zstyle -s :omz:plugins:ssh-agent lifetime lifetime zstyle -s :omz:plugins:ssh-agent lifetime lifetime