Skip to content

Commit

Permalink
add co2 compensation msg with spinner
Browse files Browse the repository at this point in the history
  • Loading branch information
Nemat97 committed Mar 8, 2024
1 parent 3f82fdb commit 261d523
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions create/application.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,8 @@ func (app *applicationCmd) Run(ctx context.Context, client *api.Client) error {
return err
}

return co2compensation()

fmt.Printf("\nYour application %q is now available at:\n https://%s\n\n", newApp.Name, newApp.Status.AtProvider.CNAMETarget)

Check failure on line 205 in create/application.go

View workflow job for this annotation

GitHub Actions / lint

unreachable: unreachable code (govet)
printUnverifiedHostsMessage(newApp)

Expand All @@ -224,6 +226,19 @@ func (app *applicationCmd) Run(ctx context.Context, client *api.Client) error {
return nil
}

func co2compensation() error {
msg := "CO2 compensated 🍃, we are saving the world"
spinner, err := format.NewSpinner(msg, msg)
if err != nil {
return err
}
if err := spinner.Start(); err != nil {
return err
}
time.Sleep(2 * time.Second)
return spinner.Stop()
}

func (app *applicationCmd) config() apps.Config {
var deployJob *apps.DeployJob

Expand Down

0 comments on commit 261d523

Please sign in to comment.