mirror of
https://github.com/nishiki/manage-password.git
synced 2024-11-23 13:57:52 +00:00
add sync after add, update or delete action
This commit is contained in:
parent
b51144758d
commit
460450ce08
1 changed files with 5 additions and 0 deletions
|
@ -213,6 +213,7 @@ class Cli
|
|||
def add_key(key, file=nil)
|
||||
@mpw.add_key(key, file)
|
||||
@mpw.write_data
|
||||
@mpw.sync
|
||||
|
||||
puts "#{I18n.t('key.add.valid')}".green
|
||||
rescue Exception => e
|
||||
|
@ -224,6 +225,7 @@ class Cli
|
|||
def delete_key(key)
|
||||
@mpw.delete_key(key)
|
||||
@mpw.write_data
|
||||
@mpw.sync
|
||||
|
||||
puts "#{I18n.t('key.delete.valid')}".green
|
||||
rescue Exception => e
|
||||
|
@ -250,6 +252,7 @@ class Cli
|
|||
@mpw.add(item)
|
||||
@mpw.set_password(item.id, password)
|
||||
@mpw.write_data
|
||||
@mpw.sync
|
||||
|
||||
puts "#{I18n.t('form.add.valid')}".green
|
||||
end
|
||||
|
@ -278,6 +281,7 @@ class Cli
|
|||
item.update(options)
|
||||
@mpw.set_password(item.id, password) if not password.empty?
|
||||
@mpw.write_data
|
||||
@mpw.sync
|
||||
|
||||
puts "#{I18n.t('form.update.valid')}".green
|
||||
else
|
||||
|
@ -309,6 +313,7 @@ class Cli
|
|||
|
||||
item.delete
|
||||
@mpw.write_data
|
||||
@mpw.sync
|
||||
|
||||
puts "#{I18n.t('form.delete.valid', id: id)}".green
|
||||
rescue
|
||||
|
|
Loading…
Reference in a new issue