1
0
Fork 0
mirror of https://github.com/nishiki/manage-password.git synced 2024-11-30 08:53:05 +00:00

minor fix for add key pub

This commit is contained in:
nishiki 2016-05-07 16:27:55 +02:00
parent ad1713edcb
commit 7759c3e1eb
2 changed files with 3 additions and 1 deletions

View file

@ -140,7 +140,7 @@ class MPW
# Add public key # Add public key
# args: key -> new public key # args: key -> new public key
def add_key(key) def add_key(key)
data = GPGME::Key.export(key).read data = GPGME::Key.export(key, armor: true).read
if data.to_s.empty? if data.to_s.empty?
raise I18n.t('error.export_key') raise I18n.t('error.export_key')

View file

@ -190,6 +190,8 @@ class Cli
def add_key(key) def add_key(key)
@mpw.add_key(key) @mpw.add_key(key)
@mpw.write_data @mpw.write_data
puts "#{I18n.t('key.add.valid')}".green
rescue Exception => e rescue Exception => e
puts "#{I18n.t('display.error')} #13: #{e}".red puts "#{I18n.t('display.error')} #13: #{e}".red
end end