summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2023-05-26 18:14:01 +0300
committerPaul Buetow <paul@buetow.org>2023-05-26 18:14:01 +0300
commitffb0109a9628a4769e426a74ac1244eeaaf51aca (patch)
tree44b85b299452c51a8150888b36075be60bc0443f
parent26b7b9c20a91fafab696d784b18aafe59006fd70 (diff)
fix
-rwxr-xr-xgeheim.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/geheim.rb b/geheim.rb
index 2b8035e..b23b018 100755
--- a/geheim.rb
+++ b/geheim.rb
@@ -39,7 +39,9 @@ module Log
puts "#{prefix} #{line}"
end
end
- end
+ rescue => e
+ log(e)
+ end
end
module Git
@@ -161,7 +163,7 @@ class CommitFile
include Log
def commit_content(file:, content:, force: false)
- if File.exists?(file) and !force
+ if File.exist?(file) and !force
fatal "#{file} already exists"
end
@@ -412,7 +414,7 @@ class Geheim
hash = hash_path(dest_path)
- fatal "#{file} does not exist!" unless File.exists?(src_path)
+ fatal "#{file} does not exist!" unless File.exist?(src_path)
log "Importing #{src_path} -> #{dest_path}"
data = File.read(src_path)
shred_file(file: src_path) if action == :newtxt