Update plugins/ssh-agent/ssh-agent.plugin.zsh

This commit is contained in:
Carlo Sala 2024-10-10 13:38:48 +02:00 committed by GitHub
commit 8c60c2ddb7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -45,7 +45,7 @@ function _add_identities() {
# Iterate over files in .ssh folder.
for file in "$HOME/.ssh"/*; do
# Check if file is a regular file and starts with "-----BEGIN OPENSSH PRIVATE KEY-----".
if [[ -f "$file" && $(head -n 1 "$file") =~ ^-----BEGIN\ OPENSSH\ PRIVATE\ KEY----- ]]; then
if [[ -f "$file" && $(command head -n 1 "$file") =~ ^-----BEGIN\ OPENSSH\ PRIVATE\ KEY----- ]]; then
# Add filename (without path) to identities array.
identities+=("${file##*/}")
fi