]> gitweb.fluxo.info Git - leap/leap_cli.git/commitdiff
make gpg optional
authorelijah <elijah@riseup.net>
Thu, 25 Oct 2012 20:47:50 +0000 (13:47 -0700)
committerelijah <elijah@riseup.net>
Thu, 25 Oct 2012 20:47:50 +0000 (13:47 -0700)
lib/leap_cli/commands/user.rb

index 5f7702a84ddfa5682737e1d57e56d160b2d62edc..ed56ff4de1180f11d57490c6a9615c35ebf39164 100644 (file)
@@ -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|