Skip to content

Commit 8c6bafc

Browse files
committed
start: unlink leaves file if already present
Fixes #206.
1 parent eb9cf8f commit 8c6bafc

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/autoupdate/start.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ def start(interval:, args:)
8080
script_path = Autoupdate::Core.location/"brew_autoupdate_leaves"
8181
# Ensure the directory exists
8282
FileUtils.mkpath(Autoupdate::Core.location)
83+
script_path.unlink if script_path.exist? # Remove existing script if it exists to prevent error on recreation.
8384
File.open(script_path, "w") { |f| f << temp_script }
8485
FileUtils.chmod 0555, script_path
8586

0 commit comments

Comments
 (0)