From ea0c20cfe7d240dc9d55c8eabfee3fef2cb6ff54 Mon Sep 17 00:00:00 2001 From: c9s Date: Fri, 5 Feb 2021 13:04:52 +0800 Subject: [PATCH] rename enableApiServer to enableWebServer --- pkg/cmd/run.go | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/pkg/cmd/run.go b/pkg/cmd/run.go index ccb0e7415..b246d2d59 100644 --- a/pkg/cmd/run.go +++ b/pkg/cmd/run.go @@ -331,7 +331,7 @@ func run(cmd *cobra.Command, args []string) error { return err } - enableApiServer, err := cmd.Flags().GetBool("enable-web-server") + enableWebServer, err := cmd.Flags().GetBool("enable-web-server") if err != nil { return err } @@ -348,10 +348,7 @@ func run(cmd *cobra.Command, args []string) error { var userConfig = &bbgo.Config{} - if setup { - log.Infof("running in setup mode, skip reading config file") - enableApiServer = true - } else { + if !setup { // if it's not setup, then the config file option is required. if len(configFile) == 0 { return errors.New("--config option is required") @@ -377,7 +374,7 @@ func run(cmd *cobra.Command, args []string) error { } if setup { - return runSetup(ctx, userConfig, enableApiServer) + return runSetup(ctx, userConfig, true) } userConfig, err = bbgo.Load(configFile, true) @@ -385,7 +382,7 @@ func run(cmd *cobra.Command, args []string) error { return err } - return runConfig(ctx, userConfig, enableApiServer) + return runConfig(ctx, userConfig, enableWebServer) } return runWrapperBinary(ctx, userConfig, cmd, args)