From ffb0109a9628a4769e426a74ac1244eeaaf51aca Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Fri, 26 May 2023 18:14:01 +0300 Subject: fix --- geheim.rb | 8 +++++--- 1 file 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 -- cgit v1.2.3