Skip to content

Commit

Permalink
fix compile flag check
Browse files Browse the repository at this point in the history
  • Loading branch information
c9s committed Dec 9, 2020
1 parent 846f463 commit f595b1e
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions pkg/cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ func runConfig(basectx context.Context, userConfig *bbgo.Config) error {
}
}


trader := bbgo.NewTrader(environ)

if userConfig.RiskControls != nil {
Expand Down Expand Up @@ -250,8 +249,10 @@ var RunCmd = &cobra.Command{
return err
}

shouldCompile := len(userConfig.Imports) > 0

// if there is no custom imports, we don't have to compile
if noCompile {
if noCompile || !shouldCompile {
userConfig, err = bbgo.Load(configFile)
if err != nil {
return err
Expand All @@ -265,11 +266,6 @@ var RunCmd = &cobra.Command{
return nil
}

shouldCompile := len(userConfig.Imports) > 0
if shouldCompile {
log.Infof("found imports %v, compiling wrapper binary...", userConfig.Imports)
}

var runArgs = []string{"run", "--no-compile"}
cmd.Flags().Visit(func(flag *flag.Flag) {
runArgs = append(runArgs, "--"+flag.Name, flag.Value.String())
Expand Down

0 comments on commit f595b1e

Please sign in to comment.