Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Ohmyzsh
Commits
8eba1920
Unverified
Commit
8eba1920
authored
6 years ago
by
Marc Cornellà
Committed by
GitHub
6 years ago
Browse files
Options
Download
Email Patches
Plain Diff
Revert to checking if `enable-ssh-support` is set
Fixes #6772
parent
9cd3701a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
plugins/gpg-agent/gpg-agent.plugin.zsh
+7
-7
plugins/gpg-agent/gpg-agent.plugin.zsh
with
7 additions
and
7 deletions
+7
-7
plugins/gpg-agent/gpg-agent.plugin.zsh
View file @
8eba1920
# Enable gpg-agent if it is not running-
# --use-standard-socket will work from version 2 upwards
AGENT_SOCK
=
`
gpgconf
--list-dirs
|
grep
agent-socket |
cut
-d
:
-f
2
`
AGENT_SOCK
=
$(
gpgconf
--list-dirs
|
grep
agent-socket |
cut
-d
:
-f
2
)
if
[
!
-S
$
{
AGENT_SOCK
}
]
;
then
gpg-agent
--daemon
--use-standard-socket
>
/dev/null
2>&1
if
[
[
!
-S
$AGENT_SOCK
]
]
;
then
gpg-agent
--daemon
--use-standard-socket
&
>/dev/null
fi
export
GPG_TTY
=
$
(
tty
)
export
GPG_TTY
=
$
TTY
# Set SSH to use gpg-agent if it's enabled
if
[
-S
"
${
AGENT_SOCK
}
.ssh"
]
;
then
export
SSH_AUTH_SOCK
=
"
${
AGENT_SOCK
}
.ssh"
GNUPGCONFIG
=
"
${
GNUPGHOME
:-
"
$HOME
/.gnupg"
}
/gpg-agent.conf"
if
[[
-r
$GNUPGCONFIG
]]
&&
command grep
-q
enable-ssh-support
"
$GNUPGCONFIG
"
;
then
export
SSH_AUTH_SOCK
=
"
$AGENT_SOCK
.ssh"
unset
SSH_AGENT_PID
fi
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help