1
0
mirror of https://github.com/dcarrillo/prezto.git synced 2025-06-14 21:51:42 +00:00

Cleaned up the plugins.

This commit is contained in:
Sorin Ionescu
2011-08-30 23:16:15 -04:00
parent 422307c3ca
commit 90e7debc30
66 changed files with 902 additions and 1774 deletions

View File

@ -1,21 +1,25 @@
# Based on ssh-agent code
# Based on ssh-agent code.
local GPG_ENV=$HOME/.gnupg/gpg-agent.env
local GPG_ENV="$HOME/.gnupg/gpg-agent.env"
function start_agent {
/usr/bin/env gpg-agent --daemon --enable-ssh-support --write-env-file ${GPG_ENV} > /dev/null
chmod 600 ${GPG_ENV}
. ${GPG_ENV} > /dev/null
if (( ! $+commands[gpg-agent] )); then
return
fi
function _gpg-agent-start() {
/usr/bin/env gpg-agent --daemon --enable-ssh-support --write-env-file "${GPG_ENV}" > /dev/null
chmod 600 "${GPG_ENV}"
source "${GPG_ENV}" > /dev/null
}
# Source GPG agent settings, if applicable
if [ -f "${GPG_ENV}" ]; then
. ${GPG_ENV} > /dev/null
ps -ef | grep ${SSH_AGENT_PID} | grep gpg-agent > /dev/null || {
start_agent;
# Source GPG agent settings, if applicable.
if [[ -f "${GPG_ENV}" ]]; then
source "${GPG_ENV}" > /dev/null
ps -ef | grep "${SSH_AGENT_PID}" | grep gpg-agent > /dev/null || {
_gpg-agent-start;
}
else
start_agent;
_gpg-agent-start;
fi
export GPG_AGENT_INFO
@ -24,3 +28,4 @@ export SSH_AGENT_PID
GPG_TTY=$(tty)
export GPG_TTY