summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xgeheim.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/geheim.rb b/geheim.rb
index 2d0f3bc..3a023a2 100755
--- a/geheim.rb
+++ b/geheim.rb
@@ -182,6 +182,11 @@ class GeheimData < CommitFile
end
end
+ def import(source_file:)
+ puts "Importing #{source_file} to #{@data_path}"
+ @data = File.read(source_file)
+ end
+
def commit(force: false)
commit_content(file: @data_path, content: encrypt(plain: @data), force: force)
end
@@ -270,7 +275,10 @@ class Geheim
destination_file = File.basename(index.description)
data = index.get_data
data.export(destination_file: destination_file)
- shred_file(file: edit_exported(file: destination_file))
+ edited_file = edit_exported(file: destination_file)
+ data.import(source_file: edited_file)
+ data.commit(force: true)
+ shred_file(file: edited_file)
end
end
end