Files
go-worm/lib/instance/detach.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

20 lines
297 B
Go

package instance
import (
"fmt"
"os"
"tea.chunkbyte.com/kato/go-worm/lib/config"
)
func Detach() error {
if AlreadyRunning() {
return fmt.Errorf("agent already running")
}
exe, err := config.InstalledExe()
if err != nil {
return err
}
return Launch(exe, filterArgs(os.Args[1:]))
}