Add selfupdate: replace the running program with the newest Gitea release
CI / test (push) Successful in 1m56s
CI / test (push) Successful in 1m56s
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
b37b18c40d
commit
d1bbd28fb0
4 files changed
+456
No files matched your search
@@ -0,0 +1,13 @@
|
||||
//go:build !windows
|
||||
|
||||
package selfupdate
|
||||
|
||||
import (
|
||||
"os"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
// 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())
|
||||
}
|
||||
Reference in new issue
Block a user