mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-25 16:25:16 +00:00
fix compile flag check
This commit is contained in:
parent
846f463cfc
commit
f595b1ef65
|
@ -171,7 +171,6 @@ func runConfig(basectx context.Context, userConfig *bbgo.Config) error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
trader := bbgo.NewTrader(environ)
|
trader := bbgo.NewTrader(environ)
|
||||||
|
|
||||||
if userConfig.RiskControls != nil {
|
if userConfig.RiskControls != nil {
|
||||||
|
@ -250,8 +249,10 @@ var RunCmd = &cobra.Command{
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
shouldCompile := len(userConfig.Imports) > 0
|
||||||
|
|
||||||
// if there is no custom imports, we don't have to compile
|
// if there is no custom imports, we don't have to compile
|
||||||
if noCompile {
|
if noCompile || !shouldCompile {
|
||||||
userConfig, err = bbgo.Load(configFile)
|
userConfig, err = bbgo.Load(configFile)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
@ -265,11 +266,6 @@ var RunCmd = &cobra.Command{
|
||||||
return nil
|
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"}
|
var runArgs = []string{"run", "--no-compile"}
|
||||||
cmd.Flags().Visit(func(flag *flag.Flag) {
|
cmd.Flags().Visit(func(flag *flag.Flag) {
|
||||||
runArgs = append(runArgs, "--"+flag.Name, flag.Value.String())
|
runArgs = append(runArgs, "--"+flag.Name, flag.Value.String())
|
||||||
|
|
Loading…
Reference in New Issue
Block a user