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
bd895149ad
commit
dbfc1caa53
|
@ -19,11 +19,15 @@ import (
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
dotenvFile := ".env.local"
|
dotenvFile := ".env.local"
|
||||||
if err := godotenv.Load(dotenvFile); err != nil {
|
|
||||||
log.WithError(err).Error("error loading dotenv file")
|
if _, err := os.Stat(dotenvFile) ; err == nil {
|
||||||
return
|
if err := godotenv.Load(dotenvFile); err != nil {
|
||||||
|
log.WithError(err).Error("error loading dotenv file")
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var args []string
|
var args []string
|
||||||
if runtime.GOOS == "linux" {
|
if runtime.GOOS == "linux" {
|
||||||
args = append(args, "--class=bbgo")
|
args = append(args, "--class=bbgo")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user