1
0
Fork 0
mirror of https://github.com/nishiki/manage-password.git synced 2024-11-27 07:33:05 +00:00

cli: fix update function

This commit is contained in:
nishiki 2016-05-05 23:14:28 +02:00
parent b86e095a60
commit 38beb7ad53

View file

@ -198,13 +198,15 @@ class Cli
options.delete_if { |k,v| v.empty? } options.delete_if { |k,v| v.empty? }
item.update(options) item.update(options)
@mpw.encrypt @mpw.set_password(item.id, password) if not password.empty?
@mpw.write_data @mpw.write_data
puts "#{I18n.t('form.update.valid')}".green puts "#{I18n.t('form.update.valid')}".green
else else
puts I18n.t('display.nothing') puts I18n.t('display.nothing')
end end
rescue Exception => e
puts "#{I18n.t('display.error')} #14: #{e}".red
end end
# Remove an item # Remove an item