Skip to content

Commit

Permalink
支持通过绝对路径运行gocron ouqiang#45
Browse files Browse the repository at this point in the history
  • Loading branch information
ouqiang committed Apr 17, 2018
1 parent 83f8b67 commit 64128f3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cmd/gocron/gocron.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// main gocron
// Command gocron

package main

Expand Down
3 changes: 1 addition & 2 deletions cmd/node/node.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// main gocron-node

// Command gocron-node
package main

import (
Expand Down
5 changes: 3 additions & 2 deletions internal/modules/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package app

import (
"os"
"path/filepath"

"fmt"
"io/ioutil"
Expand All @@ -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"
Expand Down

0 comments on commit 64128f3

Please sign in to comment.