mirror of https://github.com/nirenjan/dotfiles.git
Wrap gpg snippet to ensure that the command is available
parent
9da5e26220
commit
a866ab7d4e
19
zsh/gpg.zsh
19
zsh/gpg.zsh
|
@ -1,10 +1,13 @@
|
|||
gpgconf --launch gpg-agent
|
||||
|
||||
export SSH_AUTH_SOCK="$HOME/.gnupg/S.gpg-agent.ssh"
|
||||
|
||||
TSOCK=$(gpgconf --list-dirs agent-ssh-socket || true)
|
||||
if [[ -n "$TSOCK" ]]
|
||||
if command -v gpgconf >/dev/null
|
||||
then
|
||||
export SSH_AUTH_SOCK="$TSOCK"
|
||||
unset TSOCK
|
||||
gpgconf --launch gpg-agent
|
||||
|
||||
export SSH_AUTH_SOCK="$HOME/.gnupg/S.gpg-agent.ssh"
|
||||
|
||||
TSOCK=$(gpgconf --list-dirs agent-ssh-socket || true)
|
||||
if [[ -n "$TSOCK" ]]
|
||||
then
|
||||
export SSH_AUTH_SOCK="$TSOCK"
|
||||
unset TSOCK
|
||||
fi
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue