diff --git a/.gitignore b/.gitignore index 397d8eb..fd9d3c2 100644 --- a/.gitignore +++ b/.gitignore @@ -2,5 +2,6 @@ .git bindata.go *.exe +beancount-gs gin.log config.json \ No newline at end of file diff --git a/beancount-gs b/beancount-gs deleted file mode 100755 index 995d9aa..0000000 Binary files a/beancount-gs and /dev/null differ diff --git a/script/config.go b/script/config.go index efce86b..b358496 100644 --- a/script/config.go +++ b/script/config.go @@ -209,10 +209,14 @@ func LoadLedgerConfigMap() error { if err != nil { return err } - err = json.Unmarshal(fileContent, &ledgerConfigMap) - if err != nil { - LogSystemError("Failed unmarshal ledger_config file (" + path + ")") - return err + if string(fileContent) != "" { + err = json.Unmarshal(fileContent, &ledgerConfigMap) + if err != nil { + LogSystemError("Failed unmarshal ledger_config file (" + path + ")") + return err + } + } else { + ledgerConfigMap = make(map[string]Config) } LogSystemInfo("Success load ledger_config file (" + path + ")") } diff --git a/script/paths.go b/script/paths.go index c7022c2..e0abbe4 100644 --- a/script/paths.go +++ b/script/paths.go @@ -3,11 +3,13 @@ package script import "os" func GetServerConfigFilePath() string { - return "./config/config.json" + currentPath, _ := os.Getwd() + return currentPath + "/config/config.json" } func GetServerWhiteListFilePath() string { - return "./config/white_list.json" + currentPath, _ := os.Getwd() + return currentPath + "/config/white_list.json" } func GetServerLedgerConfigFilePath() string {