mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
if dotenv file does not exist, do not load it
This commit is contained in:
parent
39fa0ef810
commit
bd895149ad
|
@ -320,8 +320,10 @@ func run(cmd *cobra.Command, args []string) error {
|
|||
return err
|
||||
}
|
||||
|
||||
if err := godotenv.Load(dotenvFile); err != nil {
|
||||
return errors.Wrap(err, "error loading dotenv file")
|
||||
if _, err := os.Stat(dotenvFile) ; err == nil {
|
||||
if err := godotenv.Load(dotenvFile); err != nil {
|
||||
return errors.Wrap(err, "error loading dotenv file")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user