Skip to content

Commit

Permalink
test that each email 'told' exists in user's keyring. Closes #176
Browse files Browse the repository at this point in the history
  • Loading branch information
joshr committed Jul 17, 2018
1 parent 673946a commit 2e074aa
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/commands/git_secret_tell.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,20 @@ function tell {
_abort "you must provide at least one email address."
fi

local gpg_uids
gpg_uids=$(_get_users_in_gpg_keyring)
for email in "${emails[@]}"; do
local email_ok=0
for uid in $gpg_uids; do
if [[ "$uid" == "$email" ]]; then
email_ok=1
fi
done
if [[ "$email_ok" == 0 ]]; then
_abort "email not found in gpg keyring: $email"
fi
done

local start_key_cnt
start_key_cnt=$(get_gpg_key_count)
for email in "${emails[@]}"; do
Expand Down

0 comments on commit 2e074aa

Please sign in to comment.