From 416b921d71e4e8c6095e5631431d59d3194a1c33 Mon Sep 17 00:00:00 2001 From: Veillax <126523099+Veillax@users.noreply.github.com> Date: Mon, 26 Oct 2026 13:58:02 -0600 Subject: [PATCH] Export selfupdate.Restart Co-Authored-By: Claude Sonnet 5.5 --- selfupdate/restart_unix.go | 4 ++-- selfupdate/restart_windows.go | 2 +- selfupdate/selfupdate.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/selfupdate/restart_unix.go b/selfupdate/restart_unix.go index d4ceae0..20f812b 100644 --- a/selfupdate/restart_unix.go +++ b/selfupdate/restart_unix.go @@ -7,7 +7,7 @@ import ( "syscall" ) -// restart replaces this process with the new binary, with the same arguments and environment. -func restart(exe string) error { +// Restart replaces this process with the new binary, with the same arguments and environment. +func Restart(exe string) error { return syscall.Exec(exe, os.Args, os.Environ()) } diff --git a/selfupdate/restart_windows.go b/selfupdate/restart_windows.go index 1d0d2ba..8681be2 100644 --- a/selfupdate/restart_windows.go +++ b/selfupdate/restart_windows.go @@ -2,6 +2,6 @@ package selfupdate import "errors" -func restart(string) error { +func Restart(string) error { return errors.New("restarting in place is not supported on Windows") } diff --git a/selfupdate/selfupdate.go b/selfupdate/selfupdate.go index 457c20a..9662dbd 100644 --- a/selfupdate/selfupdate.go +++ b/selfupdate/selfupdate.go @@ -72,7 +72,7 @@ func (c *Config) defaults() { c.Verify = verifyRuns(c.App) } if c.Restart == nil { - c.Restart = restart + c.Restart = Restart } c.Server = strings.TrimRight(c.Server, "/") }