summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2025-11-01 22:58:50 +0200
committerPaul Buetow <paul@buetow.org>2025-11-01 22:58:50 +0200
commit829b6cf7b4991f76bbf3ade3e31c617b2ca63361 (patch)
treeaead121d716d35f08a6e315d233c894f3ccc6a86
parent19de591d88b07153e431ab6c73f708cd751f0782 (diff)
some improvements
-rwxr-xr-xgeheim.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/geheim.rb b/geheim.rb
index bdb8cdd..f1db252 100755
--- a/geheim.rb
+++ b/geheim.rb
@@ -203,7 +203,10 @@ class CommitFile
include Log
def commit_content(file:, content:, force: false)
- fatal "#{file} already exists" if File.exist?(file) && !force
+ if File.exist?(file) && !force
+ warn "#{file} already exists. Use 'force' flag to overwrite."
+ return false
+ end
dirname = File.dirname(file)
unless File.directory?(dirname)
@@ -589,6 +592,7 @@ class CLI
help
shell
HELP
+ 0
end
def shell_loop(argv)