mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-04 07:26:47 +00:00
Config overwrite bugfix (#363)
* Fix bug where on parsing an alternate new config it will overwrite main config.json in gct dir * Stop movement of config.json file from root dir when a new config is parsed in * Stop overiding config.json at gct dir with new config.json from root directory * RM LN :D * Fix bug where promptforconfig in config_encryption.go overwrites default config Ensure periphery command packages do not interact or save over configuration Ensure tests to not save over or change current testdata/config
This commit is contained in:
committed by
Adrian Gallagher
parent
6bdbe236c0
commit
e2d57540a6
10
main.go
10
main.go
@@ -8,7 +8,6 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/thrasher-corp/gocryptotrader/common"
|
||||
"github.com/thrasher-corp/gocryptotrader/config"
|
||||
"github.com/thrasher-corp/gocryptotrader/core"
|
||||
mg "github.com/thrasher-corp/gocryptotrader/database/migration"
|
||||
"github.com/thrasher-corp/gocryptotrader/engine"
|
||||
@@ -18,18 +17,12 @@ import (
|
||||
)
|
||||
|
||||
func main() {
|
||||
defaultPath, err := config.GetFilePath("")
|
||||
if err != nil {
|
||||
log.Errorln(log.Global, err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
// Handle flags
|
||||
var settings engine.Settings
|
||||
versionFlag := flag.Bool("version", false, "retrieves current GoCryptoTrader version")
|
||||
|
||||
// Core settings
|
||||
flag.StringVar(&settings.ConfigFile, "config", defaultPath, "config file to load")
|
||||
flag.StringVar(&settings.ConfigFile, "config", "", "config file to load")
|
||||
flag.StringVar(&settings.DataDir, "datadir", common.GetDefaultDataDir(runtime.GOOS), "default data directory for GoCryptoTrader files")
|
||||
flag.StringVar(&settings.MigrationDir, "migrationdir", mg.MigrationDir, "override migration folder")
|
||||
flag.IntVar(&settings.GoMaxProcs, "gomaxprocs", runtime.NumCPU(), "sets the runtime GOMAXPROCS value")
|
||||
@@ -92,6 +85,7 @@ func main() {
|
||||
fmt.Println(core.Banner)
|
||||
fmt.Println(core.Version(false))
|
||||
|
||||
var err error
|
||||
engine.Bot, err = engine.NewFromSettings(&settings)
|
||||
if engine.Bot == nil || err != nil {
|
||||
log.Errorf(log.Global, "Unable to initialise bot engine. Error: %s\n", err)
|
||||
|
||||
Reference in New Issue
Block a user