Skip to content

Commit a62bfdb

Browse files
committed
Fix restart after program has died
1 parent f52a61b commit a62bfdb

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

main.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,11 @@ func (s *Script) Stop(lock bool) error {
194194
signal = syscall.SIGKILL
195195
}
196196

197+
// make sure the process is not dead
198+
if s.command.ProcessState != nil && s.command.ProcessState.Exited() {
199+
return nil
200+
}
201+
197202
if err := syscall.Kill(-s.command.Process.Pid, signal); err != nil {
198203
log.Printf("error killing previous process: %v", err)
199204
return err

zqdgr.config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "zqdgr",
3-
"version": "0.0.4",
3+
"version": "0.0.4a",
44
"description": "zqdgr is a quick and dirty Golang runner",
55
"author": "juls0730",
66
"license": "BSL-1.0",

0 commit comments

Comments
 (0)