summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Bütow <paul@uranus.lan.buetow.org>2018-09-02 18:33:38 +0100
committerPaul Bütow <paul@uranus.lan.buetow.org>2018-09-02 18:33:38 +0100
commit030e014769f6423f901f33f23a3e949b76aa3e42 (patch)
tree8afd2b38ef5e1cfad0d69c5179067454136d6da5
parent7050182d32cea58440b240cbcb2dc5cd1264e0ea (diff)
can edit
-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