Skip to content
This repository was archived by the owner on Dec 17, 2025. It is now read-only.

Commit ef97a18

Browse files
committed
Improved autoupdate handling
Don't try to run the new binary. Running on next use is fine enough
1 parent 5f01ae3 commit ef97a18

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

internal/autoupdate/autoupdate.go

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ import (
55
"fmt"
66
"os"
77
"path/filepath"
8-
"runtime"
9-
"syscall"
108
"time"
119

1210
"github.com/creativeprojects/go-selfupdate"
@@ -71,17 +69,9 @@ func checkAndUpdate() error {
7169
log := logger.Get()
7270
log.Info("autoupdate completed", "old_version", currentVersion, "new_version", release.Version)
7371

74-
// Successfully updated to a new version!
75-
if runtime.GOOS != "windows" {
76-
// On Unix-like systems, exec into the new binary to seamlessly continue
77-
exe, err := os.Executable()
78-
if err == nil {
79-
_ = syscall.Exec(exe, os.Args, os.Environ())
80-
}
81-
}
82-
83-
// On Windows, we can't restart automatically, but the update is done
84-
// The next time they run the command, it'll be the new version
72+
// Note: We don't exec into the new binary because it can interrupt
73+
// critical operations like git clones. The new version will be used
74+
// on the next invocation.
8575
_ = release
8676

8777
return nil

0 commit comments

Comments
 (0)