tweaks to gpg agent startup
such that we give up if the ~/.gnupg directory is not yet available and silence the stdout a touch more.
This commit is contained in:
parent
e35f03aa3a
commit
4176839a4f
@ -1,3 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
function __available_projects(){
|
||||
/bin/ls $HOME/src | tr " " "\n"
|
||||
}
|
||||
@ -93,11 +95,12 @@ function get_ssh_agent(){
|
||||
|
||||
|
||||
function get_gpg_agent(){
|
||||
readlink -f "$HOME/.gnupg" >/dev/null || return 0
|
||||
agent_out="$HOME/.gnupg/agent.out"
|
||||
tmp=$(mktemp /tmp/gnupgXXXX)
|
||||
gpg-agent $* > $tmp && mv $tmp $agent_out
|
||||
|
||||
grep GPG_TTY $agent_out || \
|
||||
grep GPG_TTY $agent_out >/dev/null || \
|
||||
cat >> $agent_out <<EOF
|
||||
export GPG_TTY="$(tty)"
|
||||
EOF
|
||||
@ -154,5 +157,3 @@ function precmd(){
|
||||
function unhyphenate(){
|
||||
ruby -e "puts '$1'.gsub(/[\-_]/, ' ')"
|
||||
}
|
||||
|
||||
# vim:filetype=sh
|
||||
|
Loading…
Reference in New Issue
Block a user