Config: fix don't create empty dir when resolving path (#575)

* Config: fix don't create empty dir when resolving path

* refactor migration of default config file

* gracefully handle src == target on Move
* create target directory on Move, if necessary

* unify resolution of default config location

* refactor the use of flagSet to be explicit
* remove package variable
* use empty config file path setting if not set in flags
* resolve default file location the same way when showing the target and
when loading default config file

* don't migrate if target file is the same as source

* rename configfile to configFile

* add migrateConfig tests
This commit is contained in:
Rauno Ots
2020-10-15 04:24:43 +02:00
committed by GitHub
parent f11c904743
commit 8c86aac21d
10 changed files with 253 additions and 129 deletions

View File

@@ -181,7 +181,7 @@ func TestExchange_CancelOrder(t *testing.T) {
}
func setupEngine() (err error) {
engine.Bot, err = engine.NewFromSettings(&settings)
engine.Bot, err = engine.NewFromSettings(&settings, nil)
if err != nil {
return err
}