Fix restart after program has died
This commit is contained in:
5
main.go
5
main.go
@@ -194,6 +194,11 @@ func (s *Script) Stop(lock bool) error {
|
||||
signal = syscall.SIGKILL
|
||||
}
|
||||
|
||||
// make sure the process is not dead
|
||||
if s.command.ProcessState != nil && s.command.ProcessState.Exited() {
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := syscall.Kill(-s.command.Process.Pid, signal); err != nil {
|
||||
log.Printf("error killing previous process: %v", err)
|
||||
return err
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "zqdgr",
|
||||
"version": "0.0.4",
|
||||
"version": "0.0.4a",
|
||||
"description": "zqdgr is a quick and dirty Golang runner",
|
||||
"author": "juls0730",
|
||||
"license": "BSL-1.0",
|
||||
|
||||
Reference in New Issue
Block a user