mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 14:55:16 +00:00
disable viper config for now
This commit is contained in:
parent
332ca7ffe8
commit
3aa40f3aab
|
@ -53,6 +53,7 @@ func Execute() {
|
|||
viper.AutomaticEnv()
|
||||
|
||||
// setup the config paths for looking up the config file
|
||||
/*
|
||||
viper.AddConfigPath("config")
|
||||
viper.AddConfigPath("$HOME/.bbgo")
|
||||
viper.AddConfigPath("/etc/bbgo")
|
||||
|
@ -65,6 +66,7 @@ func Execute() {
|
|||
if err != nil {
|
||||
log.WithError(err).Fatal("failed to load config file")
|
||||
}
|
||||
*/
|
||||
|
||||
// Once the flags are defined, we can bind config keys with flags.
|
||||
if err := viper.BindPFlags(RootCmd.PersistentFlags()); err != nil {
|
||||
|
|
|
@ -204,22 +204,27 @@ func build(ctx context.Context, buildDir string, userConfig *config.Config, goOS
|
|||
return "", err
|
||||
}
|
||||
|
||||
buildEnvs := []string{"GOOS=" + goOS, "GOARCH=" + goArch}
|
||||
buildEnvs := []string{
|
||||
"GOOS=" + goOS,
|
||||
"GOARCH=" + goArch,
|
||||
}
|
||||
|
||||
buildTarget := filepath.Join(cwd, buildDir)
|
||||
log.Infof("building binary from %s...", buildTarget)
|
||||
|
||||
|
||||
binary := fmt.Sprintf("bbgow-%s-%s", goOS, goArch)
|
||||
if output != nil {
|
||||
if output != nil && len(*output) > 0 {
|
||||
binary = *output
|
||||
}
|
||||
|
||||
log.Infof("building binary %s from %s...", binary, buildTarget)
|
||||
buildCmd := exec.CommandContext(ctx, "go", "build", "-tags", "wrapper", "-o", binary, buildTarget)
|
||||
buildCmd.Env = append(os.Environ(), buildEnvs...)
|
||||
|
||||
buildCmd.Stdout = os.Stdout
|
||||
buildCmd.Stderr = os.Stderr
|
||||
if err := buildCmd.Run(); err != nil {
|
||||
return "", err
|
||||
return binary, err
|
||||
}
|
||||
|
||||
return binary, nil
|
||||
|
|
Loading…
Reference in New Issue
Block a user