You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When an error occurs, any spinner text gets broken up and somewhat duplicated across lines because the error is written to stderr (or stdout, whichever) just like the spinner. The main culprit seems to because the spinner isn't stopped first, which is what we do in the GitHub CLI.
This:
// Deploys the Azure infrastructure for the specified projectfunc (m*Manager) Deploy(ctx context.Context, plan*DeploymentPlan) (*DeployResult, error) {
// Apply the infrastructure deploymentdeployResult, err:=m.provider.Deploy(ctx, plan)
iferr!=nil {
returnnil, fmt.Errorf("error deploying infrastructure: %w", err)
}
iferr:=UpdateEnvironment(m.env, deployResult.Deployment.Outputs); err!=nil {
returnnil, fmt.Errorf("updating environment with deployment outputs: %w", err)
}
// make sure any spinner is stoppedm.console.StopSpinner(ctx, "", input.StepDone)
returndeployResult, nil
}
Should be more like this:
// Deploys the Azure infrastructure for the specified projectfunc (m*Manager) Deploy(ctx context.Context, plan*DeploymentPlan) (*DeployResult, error) {
// make sure any spinner is stoppeddeferm.console.StopSpinner(ctx, "", input.StepDone)
// Apply the infrastructure deploymentdeployResult, err:=m.provider.Deploy(ctx, plan)
iferr!=nil {
returnnil, fmt.Errorf("error deploying infrastructure: %w", err)
}
iferr:=UpdateEnvironment(m.env, deployResult.Deployment.Outputs); err!=nil {
returnnil, fmt.Errorf("updating environment with deployment outputs: %w", err)
}
returndeployResult, nil
}
Since you're only return an error, you could use defer to stop the spinner. The trickier part is when you have any code actally writing the error to stderr/stdout. Then you want to make sure you're more explicit about stopping the error.
The text was updated successfully, but these errors were encountered:
When an error occurs, any spinner text gets broken up and somewhat duplicated across lines because the error is written to stderr (or stdout, whichever) just like the spinner. The main culprit seems to because the spinner isn't stopped first, which is what we do in the GitHub CLI.
This:
Should be more like this:
Since you're only return an error, you could use
defer
to stop the spinner. The trickier part is when you have any code actally writing the error to stderr/stdout. Then you want to make sure you're more explicit about stopping the error.The text was updated successfully, but these errors were encountered: