27 lines
389 B
Go
27 lines
389 B
Go
//go:build windows
|
|
|
|
package interrupt
|
|
|
|
import (
|
|
"os"
|
|
"os/exec"
|
|
|
|
"github.com/kardianos/osext"
|
|
)
|
|
|
|
func doRestart() {
|
|
file, e := osext.Executable()
|
|
if e != nil {
|
|
E.Ln(e)
|
|
return
|
|
}
|
|
D.Ln("doing windows restart")
|
|
var s []string
|
|
s = append(s, file)
|
|
s = append(s, os.Args[1:]...)
|
|
cmd := exec.Command(s[0], s[1:]...)
|
|
D.Ln("windows restart done")
|
|
if e = cmd.Start(); E.Chk(e) {
|
|
}
|
|
}
|