From a30de8d72ab919d3378313ffeed275e19aa19be2 Mon Sep 17 00:00:00 2001 From: Sam Coe Date: Wed, 14 Sep 2022 15:33:55 +0400 Subject: [PATCH] Output paid message for codespace create to stderr not stdout (#6258) --- pkg/cmd/codespace/create.go | 2 +- pkg/cmd/codespace/create_test.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/cmd/codespace/create.go b/pkg/cmd/codespace/create.go index a5da972e3..a6bbe627f 100644 --- a/pkg/cmd/codespace/create.go +++ b/pkg/cmd/codespace/create.go @@ -150,7 +150,7 @@ func (a *App) Create(ctx context.Context, opts createOptions) error { return fmt.Errorf("error checking codespace ownership: %w", err) } else if billableOwner != nil && billableOwner.Type == "Organization" { cs := a.io.ColorScheme() - fmt.Fprintln(a.io.Out, cs.Blue(" ✓ Codespaces usage for this repository is paid for by "+billableOwner.Login)) + fmt.Fprintln(a.io.ErrOut, cs.Blue(" ✓ Codespaces usage for this repository is paid for by "+billableOwner.Login)) } if promptForRepoAndBranch { diff --git a/pkg/cmd/codespace/create_test.go b/pkg/cmd/codespace/create_test.go index b695d463d..cffe5fe43 100644 --- a/pkg/cmd/codespace/create_test.go +++ b/pkg/cmd/codespace/create_test.go @@ -406,7 +406,8 @@ Alternatively, you can run "create" with the "--default-permissions" option to c showStatus: false, idleTimeout: 30 * time.Minute, }, - wantStdout: " ✓ Codespaces usage for this repository is paid for by megacorp\nmegacorp-private-abcd1234\n", + wantStderr: " ✓ Codespaces usage for this repository is paid for by megacorp\n", + wantStdout: "megacorp-private-abcd1234\n", }, { name: "doesn't mention billable owner when it's the individual",