mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-30 02:44:42 +01:00
Fix(ssh-agent): Use "command" for reliable file type detection
The "file" command was not working reliably in some environments. Using "command file" ensures consistent behavior across different systems.
This commit is contained in:
parent
2f5817c258
commit
f37ee4e881
1 changed files with 1 additions and 1 deletions
|
|
@ -45,7 +45,7 @@ function _add_identities() {
|
|||
# Iterate over files in .ssh folder.
|
||||
for file in "$HOME/.ssh"/*; do
|
||||
# Check if file is a valid private key using file magic.
|
||||
if [[ -f "$file" && $(file -b "$file") == *"private key"* ]]; then
|
||||
if [[ -f "$file" && $(command file -b "$file") == *"private key"* ]]; then
|
||||
# Add filename (without path) to identities array.
|
||||
identities+=("${file##*/}")
|
||||
fi
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue