Files
go-worm/lib/install/relaunch_stub.go
T
kato 2318684e93 refactor(core): add headless run and auto-restart
- Run without console by default
- Log to file once console hidden
- Recover panics in background goroutines
- Restart agent after unexpected errors
- Use shared instance launch helper
2026-09-01 20:12:12 +03:00

22 lines
358 B
Go

//go:build !windows
package install
import (
"fmt"
"os"
"os/exec"
)
func relaunchInstalled(target string) error {
cmd := exec.Command(target, os.Args[1:]...)
cmd.Stdin = os.Stdin
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
if err := cmd.Start(); err != nil {
return fmt.Errorf("relaunch from %s: %w", target, err)
}
os.Exit(0)
return nil
}