Skip to content

Commit

Permalink
fix(cli): hide verbose deploy output unless requested
Browse files Browse the repository at this point in the history
  • Loading branch information
jfeodor committed Jun 11, 2024
1 parent 2abcd15 commit f635d61
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions cli/cmd/deploy/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,17 +130,23 @@ func Deploy(ctx context.Context, apps AppService, appDir, projectDir, slug strin
Handler: func(de app.DeployEvent) error {
switch de.Typename {
case "AppBuildMessageEvent":
for _, l := range strings.Split(de.BuildMessage.Message, "\n") {
task.AddLine("Build", l)
if verbose {
for _, l := range strings.Split(de.BuildMessage.Message, "\n") {
task.AddLine("Build", l)
}
}
case "AppBuildErrorEvent":
for _, l := range strings.Split(de.BuildError.Message, "\n") {
task.AddLine("Error", l)
if verbose {
for _, l := range strings.Split(de.BuildError.Message, "\n") {
task.AddLine("Error", l)
}
}

return fmt.Errorf("build error: %s", de.BuildError.Message)
case "AppDeployStatusEvent":
task.AddLine("Deploy", "Status: "+de.DeploymentStatus.Status)
case "AppDeploymentStatusEvent":
if verbose {
task.AddLine("Deploy", "Status is "+de.DeploymentStatus.Status)
}
switch de.DeploymentStatus.Status {
case "PENDING", "RUNNING":
default:
Expand Down

0 comments on commit f635d61

Please sign in to comment.