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"