mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
cmd: add directory error checking
This commit is contained in:
parent
bff73a3a80
commit
6965baa8dd
|
@ -344,9 +344,13 @@ var BacktestCmd = &cobra.Command{
|
||||||
|
|
||||||
dumpDir = filepath.Join(dumpDir, "klines")
|
dumpDir = filepath.Join(dumpDir, "klines")
|
||||||
|
|
||||||
if _, err := os.Stat(dumpDir); os.IsNotExist(err) {
|
if _, err := os.Stat(dumpDir); err != nil {
|
||||||
if err2 := os.MkdirAll(dumpDir, 0755); err2 != nil {
|
if os.IsNotExist(err) {
|
||||||
return err2
|
if err2 := os.MkdirAll(dumpDir, 0755); err2 != nil {
|
||||||
|
return err2
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user