From 442d8d47d2042dab18bdacbf0dc39ec8e42b258b Mon Sep 17 00:00:00 2001 From: janelletavares Date: Tue, 5 Apr 2022 15:23:03 -0700 Subject: [PATCH] it's both stdout and stderr --- cmd/meroxa/turbine_cli/golang/deploy.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/cmd/meroxa/turbine_cli/golang/deploy.go b/cmd/meroxa/turbine_cli/golang/deploy.go index d3e937d1c..6d0381d8a 100644 --- a/cmd/meroxa/turbine_cli/golang/deploy.go +++ b/cmd/meroxa/turbine_cli/golang/deploy.go @@ -35,13 +35,13 @@ func RunDeployApp(ctx context.Context, l log.Logger, appPath, appName, imageName cmd.Env = os.Environ() cmd.Env = append(cmd.Env, fmt.Sprintf("ACCESS_TOKEN=%s", accessToken), fmt.Sprintf("REFRESH_TOKEN=%s", refreshToken)) - stdout, err := cmd.CombinedOutput() + output, err := cmd.CombinedOutput() if err != nil { - l.Errorf(ctx, "%s", string(stdout)) + l.Errorf(ctx, "%s", string(output)) return "", fmt.Errorf("deploy failed") } - l.Infof(ctx, "%s\ndeploy complete!", string(stdout)) - return string(stdout), nil + l.Infof(ctx, "%s\ndeploy complete!", string(output)) + return string(output), nil } // NeedsToBuild reads from the Turbine application to determine whether it needs to be built or not @@ -58,14 +58,14 @@ func NeedsToBuild(appPath, appName string) (bool, error) { // TODO: Implement in Turbine something that returns a boolean rather than having to regex its output re := regexp.MustCompile(`\[(.+?)]`) - stdout, err := cmd.CombinedOutput() + output, err := cmd.CombinedOutput() if err != nil { - fmt.Println(string(stdout)) + fmt.Println(string(output)) return false, fmt.Errorf("build failed") } // stdout is expected as `"2022/03/14 17:33:06 available functions: []` where within [], there will be each function. - hasFunctions := len(re.FindAllString(string(stdout), -1)) > 0 + hasFunctions := len(re.FindAllString(string(output), -1)) > 0 return hasFunctions, nil }