summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2012-10-25 13:47:50 -0700
committerelijah <elijah@riseup.net>2012-10-25 13:47:50 -0700
commit27aab7d4cf1aeb3dce6d72d1ac12fcf0d9bdd57b (patch)
treeb6b5628acf2ed18ea20b3cb0d32935ba8cc4ee1e /lib
parent36d4b178f1d6834da0d172cf0a10ec54c94714b9 (diff)
make gpg optional
Diffstat (limited to 'lib')
-rw-r--r--lib/leap_cli/commands/user.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/leap_cli/commands/user.rb b/lib/leap_cli/commands/user.rb
index 5f7702a..ed56ff4 100644
--- a/lib/leap_cli/commands/user.rb
+++ b/lib/leap_cli/commands/user.rb
@@ -92,9 +92,12 @@ module LeapCli
#
def pick_pgp_key
secret_keys = GPGME::Key.find(:secret)
+ if secret_keys.empty?
+ progress("Skipping OpenPGP setup because I could not find any OpenPGP keys for you")
+ return nil
+ end
assert_bin! 'gpg'
- assert! secret_keys.any?, 'Sorry, could not find any OpenPGP keys for you.'
if secret_keys.length > 1
key_index = numbered_choice_menu('Choose your OpenPGP public key', secret_keys) do |key, i|