Skip to content

Commit

Permalink
Fix Issue #131 (#139)
Browse files Browse the repository at this point in the history
修复Unix下写入脚本路径以及执行方式不正确的问题
  • Loading branch information
liyk123 authored Nov 19, 2023
1 parent fc57bfe commit 0b2eb31
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sys/restart_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func NewRestarter() *UnixRestarter {
func (r *UnixRestarter) Restart(executableName string) error {
scriptContent := "#!/bin/sh\n" +
"sleep 1\n" + // Sleep for a bit to allow the main application to exit
"exec ." + executableName + "\n"
"sh -c '" + executableName + "'\n"

scriptName := "restart.sh"
if err := os.WriteFile(scriptName, []byte(scriptContent), 0755); err != nil {
Expand Down

0 comments on commit 0b2eb31

Please sign in to comment.