diff options
| author | Paul Buetow <paul@buetow.org> | 2023-09-08 21:16:22 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2023-09-08 21:16:22 +0300 |
| commit | 4de55e9b6e77445b2cfd2c7143327cd423603be2 (patch) | |
| tree | 2cbdaac65e3872a67ed1c05f0855107a71708682 | |
| parent | 6cc5f706dc290f1f314ec1137defa6ff27f9902d (diff) | |
add more stuff
| -rw-r--r-- | README.md | 2 | ||||
| -rwxr-xr-x | geheim.rb | 21 |
2 files changed, 7 insertions, 16 deletions
@@ -15,3 +15,5 @@ This is for my own use. So the documentation here may be lacking. But feel free * Works on MacOS, Linux and on Android via Termux. * Clipboard support for MacOS and GNOME (Linux). * Interactive `geheim` shell support. +* Can import and export documuments in batches. +* Can shred exported data again. @@ -4,7 +4,7 @@ require 'base64' require 'digest' require 'digest/sha2' require 'fileutils' -require 'io/console' +# require 'io/console' require 'openssl' require 'json' @@ -50,7 +50,7 @@ module Log end def warn(message) - log "WARN: #{message}" + out message, 'WARN' end def prompt(message) @@ -58,7 +58,7 @@ module Log end def fatal(message) - out "FATAL: #{message}", '!' + out message, 'FATAL' exit 3 end @@ -73,9 +73,6 @@ module Log puts "#{prefix} #{line}" end end - rescue StandardError => e - puts e.backtrace - puts e end end @@ -259,11 +256,7 @@ class GeheimData < CommitFile @exported_path = nil @data_path = "#{Config.data_dir}/#{data_file}" - @data = if data.nil? - decrypt(encrypted: File.read(@data_path)) - else - data - end + @data = data.nil? ? decrypt(encrypted: File.read(@data_path)) : data rescue StandardError => e fatal e end @@ -312,7 +305,6 @@ class Index < CommitFile @data_file = index_file.sub('.index', '.data') @index_path = "#{Config.data_dir}/#{index_file}" @hash = File.basename(index_file).sub('.index', '') - @description = description.nil? ? decrypt(encrypted: File.read(@index_path)) : description end @@ -664,7 +656,4 @@ class CLI end end -begin - cli = CLI.new - exit(cli.shell_loop(ARGV)) -end +exit(CLI.new.shell_loop(ARGV)) |
