From 64128f37e026440a1084f931a07717770eba291e Mon Sep 17 00:00:00 2001 From: ouqiang Date: Tue, 17 Apr 2018 21:10:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81=E9=80=9A=E8=BF=87=E7=BB=9D?= =?UTF-8?q?=E5=AF=B9=E8=B7=AF=E5=BE=84=E8=BF=90=E8=A1=8Cgocron=20#45?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/gocron/gocron.go | 2 +- cmd/node/node.go | 3 +-- internal/modules/app/app.go | 5 +++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cmd/gocron/gocron.go b/cmd/gocron/gocron.go index 689ed17..0972103 100644 --- a/cmd/gocron/gocron.go +++ b/cmd/gocron/gocron.go @@ -1,4 +1,4 @@ -// main gocron +// Command gocron package main diff --git a/cmd/node/node.go b/cmd/node/node.go index 3069379..30e8d59 100644 --- a/cmd/node/node.go +++ b/cmd/node/node.go @@ -1,5 +1,4 @@ -// main gocron-node - +// Command gocron-node package main import ( diff --git a/internal/modules/app/app.go b/internal/modules/app/app.go index e098b49..9f3152d 100644 --- a/internal/modules/app/app.go +++ b/internal/modules/app/app.go @@ -2,6 +2,7 @@ package app import ( "os" + "path/filepath" "fmt" "io/ioutil" @@ -27,11 +28,11 @@ var ( func InitEnv(versionString string) { logger.InitLogger() - wd, err := os.Getwd() + var err error + AppDir, err = filepath.Abs(filepath.Dir(os.Args[0])) if err != nil { logger.Fatal(err) } - AppDir = wd ConfDir = AppDir + "/conf" LogDir = AppDir + "/log" DataDir = AppDir + "/data"