Files
newt/updates/replace_unix.go
2026-10-28 09:42:56 -04:00

16 lines
440 B
Go

//go:build !windows
package updates
import "os"
// replaceBinary swaps the binary at exePath for the one at newPath. On Unix
// an atomic rename works even while the old file is being executed.
func replaceBinary(newPath, exePath string) error {
return os.Rename(newPath, exePath)
}
// removeStaleBinary is a no-op on Unix; replaceBinary never leaves a copy of
// the previous binary behind.
func removeStaleBinary(exePath string) {}