diff --git a/main.go b/main.go index 670a761..89d9d72 100644 --- a/main.go +++ b/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 diff --git a/zqdgr.config.json b/zqdgr.config.json index 50a4098..57fb854 100644 --- a/zqdgr.config.json +++ b/zqdgr.config.json @@ -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",