From 865611a17af08e8d1c40da4564a9840878c1bc56 Mon Sep 17 00:00:00 2001 From: haveatry Date: Wed, 16 Nov 2016 11:40:35 +0800 Subject: [PATCH] update the way to get file path of the exec update the way to get the exec file path --- endless.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/endless.go b/endless.go index 42c6325..b62c26c 100644 --- a/endless.go +++ b/endless.go @@ -454,7 +454,13 @@ func (srv *endlessServer) fork() (err error) { } // log.Println(files) - path := os.Args[0] + path, err := filepath.Abs(filepath.Dir(os.Args[0])) + if err != nil { + log.Fatal(err) + } + + path = path + "/" + filepath.Base(os.Args[0]) + var args []string if len(os.Args) > 1 { args = os.Args[1:]