X Tutup
Skip to content

Commit 65c19a3

Browse files
author
Alan Donovan
authored
Merge pull request cli#107 from github/spelling-again
use correct correct spelling of codespace
2 parents 45f9ae7 + c31fc05 commit 65c19a3

File tree

10 files changed

+51
-51
lines changed

10 files changed

+51
-51
lines changed

api/api.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ func (a *API) StartCodespace(ctx context.Context, token string, codespace *Codes
282282
// HTTP 503 with error code 7 (EnvironmentNotShutdown) is benign.
283283
// Ignore it.
284284
} else {
285-
return fmt.Errorf("failed to start Codespace: %s", b)
285+
return fmt.Errorf("failed to start codespace: %s", b)
286286
}
287287
}
288288

@@ -330,7 +330,7 @@ type SKU struct {
330330
func (a *API) GetCodespacesSKUs(ctx context.Context, user *User, repository *Repository, branch, location string) ([]*SKU, error) {
331331
req, err := http.NewRequest(http.MethodGet, githubAPI+"/vscs_internal/user/"+user.Login+"/skus", nil)
332332
if err != nil {
333-
return nil, fmt.Errorf("err creating request: %v", err)
333+
return nil, fmt.Errorf("error creating request: %v", err)
334334
}
335335

336336
q := req.URL.Query()

cmd/ghcs/code.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ func newCodeCmd() *cobra.Command {
1717

1818
codeCmd := &cobra.Command{
1919
Use: "code [<codespace>]",
20-
Short: "Open a Codespace in VS Code",
20+
Short: "Open a codespace in VS Code",
2121
Args: cobra.MaximumNArgs(1),
2222
RunE: func(cmd *cobra.Command, args []string) error {
2323
var codespaceName string
@@ -52,14 +52,14 @@ func code(codespaceName string, useInsiders bool) error {
5252
if err == codespaces.ErrNoCodespaces {
5353
return err
5454
}
55-
return fmt.Errorf("error choosing Codespace: %v", err)
55+
return fmt.Errorf("error choosing codespace: %v", err)
5656
}
5757
codespaceName = codespace.Name
5858
}
5959

6060
url := vscodeProtocolURL(codespaceName, useInsiders)
6161
if err := open.Run(url); err != nil {
62-
return fmt.Errorf("error opening vscode URL %s: %s. (Is VSCode installed?)", url, err)
62+
return fmt.Errorf("error opening vscode URL %s: %s. (Is VS Code installed?)", url, err)
6363
}
6464

6565
return nil

cmd/ghcs/create.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func newCreateCmd() *cobra.Command {
2727

2828
createCmd := &cobra.Command{
2929
Use: "create",
30-
Short: "Create a Codespace",
30+
Short: "Create a codespace",
3131
Args: cobra.NoArgs,
3232
RunE: func(cmd *cobra.Command, args []string) error {
3333
return create(opts)
@@ -69,12 +69,12 @@ func create(opts *createOptions) error {
6969

7070
locationResult := <-locationCh
7171
if locationResult.Err != nil {
72-
return fmt.Errorf("error getting Codespace region location: %v", locationResult.Err)
72+
return fmt.Errorf("error getting codespace region location: %v", locationResult.Err)
7373
}
7474

7575
userResult := <-userCh
7676
if userResult.Err != nil {
77-
return fmt.Errorf("error getting Codespace user: %v", userResult.Err)
77+
return fmt.Errorf("error getting codespace user: %v", userResult.Err)
7878
}
7979

8080
machine, err := getMachineName(ctx, opts.machine, userResult.User, repository, branch, locationResult.Location, apiClient)
@@ -85,11 +85,11 @@ func create(opts *createOptions) error {
8585
return errors.New("There are no available machine types for this repository")
8686
}
8787

88-
log.Println("Creating your Codespace...")
88+
log.Println("Creating your codespace...")
8989

9090
codespace, err := apiClient.CreateCodespace(ctx, userResult.User, repository, machine, branch, locationResult.Location)
9191
if err != nil {
92-
return fmt.Errorf("error creating Codespace: %v", err)
92+
return fmt.Errorf("error creating codespace: %v", err)
9393
}
9494

9595
if opts.showStatus {
@@ -154,7 +154,7 @@ func showStatus(ctx context.Context, log *output.Logger, apiClient *api.API, use
154154
}
155155

156156
if err := codespaces.PollPostCreateStates(ctx, log, apiClient, user, codespace, poller); err != nil {
157-
return fmt.Errorf("failed to poll state changes from Codespace: %v", err)
157+
return fmt.Errorf("failed to poll state changes from codespace: %v", err)
158158
}
159159

160160
return nil
@@ -228,7 +228,7 @@ func getBranchName(branch string) (string, error) {
228228
func getMachineName(ctx context.Context, machine string, user *api.User, repo *api.Repository, branch, location string, apiClient *api.API) (string, error) {
229229
skus, err := apiClient.GetCodespacesSKUs(ctx, user, repo, branch, location)
230230
if err != nil {
231-
return "", fmt.Errorf("error getting Codespace SKUs: %v", err)
231+
return "", fmt.Errorf("error requesting machine instance types: %v", err)
232232
}
233233

234234
// if user supplied a machine type, it must be valid

cmd/ghcs/delete.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
func newDeleteCmd() *cobra.Command {
1616
deleteCmd := &cobra.Command{
1717
Use: "delete [<codespace>]",
18-
Short: "Delete a Codespace",
18+
Short: "Delete a codespace",
1919
Args: cobra.MaximumNArgs(1),
2020
RunE: func(cmd *cobra.Command, args []string) error {
2121
var codespaceName string
@@ -28,7 +28,7 @@ func newDeleteCmd() *cobra.Command {
2828

2929
deleteAllCmd := &cobra.Command{
3030
Use: "all",
31-
Short: "Delete all Codespaces for the current user",
31+
Short: "Delete all codespaces for the current user",
3232
Args: cobra.NoArgs,
3333
RunE: func(cmd *cobra.Command, args []string) error {
3434
return deleteAll()
@@ -37,7 +37,7 @@ func newDeleteCmd() *cobra.Command {
3737

3838
deleteByRepoCmd := &cobra.Command{
3939
Use: "repo <repo>",
40-
Short: "Delete all Codespaces for a repository",
40+
Short: "Delete all codespaces for a repository",
4141
Args: cobra.ExactArgs(1),
4242
RunE: func(cmd *cobra.Command, args []string) error {
4343
return deleteByRepo(args[0])
@@ -65,11 +65,11 @@ func delete_(codespaceName string) error {
6565

6666
codespace, token, err := codespaces.GetOrChooseCodespace(ctx, apiClient, user, codespaceName)
6767
if err != nil {
68-
return fmt.Errorf("get or choose Codespace: %v", err)
68+
return fmt.Errorf("get or choose codespace: %v", err)
6969
}
7070

7171
if err := apiClient.DeleteCodespace(ctx, user, token, codespace.Name); err != nil {
72-
return fmt.Errorf("error deleting Codespace: %v", err)
72+
return fmt.Errorf("error deleting codespace: %v", err)
7373
}
7474

7575
log.Println("Codespace deleted.")
@@ -89,17 +89,17 @@ func deleteAll() error {
8989

9090
codespaces, err := apiClient.ListCodespaces(ctx, user)
9191
if err != nil {
92-
return fmt.Errorf("error getting Codespaces: %v", err)
92+
return fmt.Errorf("error getting codespaces: %v", err)
9393
}
9494

9595
for _, c := range codespaces {
9696
token, err := apiClient.GetCodespaceToken(ctx, user.Login, c.Name)
9797
if err != nil {
98-
return fmt.Errorf("error getting Codespace token: %v", err)
98+
return fmt.Errorf("error getting codespace token: %v", err)
9999
}
100100

101101
if err := apiClient.DeleteCodespace(ctx, user, token, c.Name); err != nil {
102-
return fmt.Errorf("error deleting Codespace: %v", err)
102+
return fmt.Errorf("error deleting codespace: %v", err)
103103
}
104104

105105
log.Printf("Codespace deleted: %s\n", c.Name)
@@ -120,7 +120,7 @@ func deleteByRepo(repo string) error {
120120

121121
codespaces, err := apiClient.ListCodespaces(ctx, user)
122122
if err != nil {
123-
return fmt.Errorf("error getting Codespaces: %v", err)
123+
return fmt.Errorf("error getting codespaces: %v", err)
124124
}
125125

126126
var deleted bool
@@ -132,18 +132,18 @@ func deleteByRepo(repo string) error {
132132

133133
token, err := apiClient.GetCodespaceToken(ctx, user.Login, c.Name)
134134
if err != nil {
135-
return fmt.Errorf("error getting Codespace token: %v", err)
135+
return fmt.Errorf("error getting codespace token: %v", err)
136136
}
137137

138138
if err := apiClient.DeleteCodespace(ctx, user, token, c.Name); err != nil {
139-
return fmt.Errorf("error deleting Codespace: %v", err)
139+
return fmt.Errorf("error deleting codespace: %v", err)
140140
}
141141

142142
log.Printf("Codespace deleted: %s\n", c.Name)
143143
}
144144

145145
if !deleted {
146-
return fmt.Errorf("No Codespace was found for repository: %s", repo)
146+
return fmt.Errorf("No codespace was found for repository: %s", repo)
147147
}
148148

149149
return list(&listOptions{})

cmd/ghcs/list.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ func newListCmd() *cobra.Command {
1919

2020
listCmd := &cobra.Command{
2121
Use: "list",
22-
Short: "List your Codespaces",
22+
Short: "List your codespaces",
2323
Args: cobra.NoArgs,
2424
RunE: func(cmd *cobra.Command, args []string) error {
2525
return list(opts)
@@ -46,7 +46,7 @@ func list(opts *listOptions) error {
4646

4747
codespaces, err := apiClient.ListCodespaces(ctx, user)
4848
if err != nil {
49-
return fmt.Errorf("error getting Codespaces: %v", err)
49+
return fmt.Errorf("error getting codespaces: %v", err)
5050
}
5151

5252
table := output.NewTable(os.Stdout, opts.asJSON)

cmd/ghcs/logs.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ func newLogsCmd() *cobra.Command {
1616

1717
logsCmd := &cobra.Command{
1818
Use: "logs [<codespace>]",
19-
Short: "Access Codespace logs",
19+
Short: "Access codespace logs",
2020
Args: cobra.MaximumNArgs(1),
2121
RunE: func(cmd *cobra.Command, args []string) error {
2222
var codespaceName string
@@ -51,7 +51,7 @@ func logs(ctx context.Context, tail bool, codespaceName string) error {
5151

5252
codespace, token, err := codespaces.GetOrChooseCodespace(ctx, apiClient, user, codespaceName)
5353
if err != nil {
54-
return fmt.Errorf("get or choose Codespace: %v", err)
54+
return fmt.Errorf("get or choose codespace: %v", err)
5555
}
5656

5757
lsclient, err := codespaces.ConnectToLiveshare(ctx, log, apiClient, user.Login, token, codespace)

cmd/ghcs/ports.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ func newPortsCmd() *cobra.Command {
3535

3636
portsCmd := &cobra.Command{
3737
Use: "ports",
38-
Short: "List ports in a Codespace",
38+
Short: "List ports in a codespace",
3939
Args: cobra.NoArgs,
4040
RunE: func(cmd *cobra.Command, args []string) error {
4141
return ports(opts)
4242
},
4343
}
4444

45-
portsCmd.Flags().StringVarP(&opts.codespaceName, "codespace", "c", "", "The `name` of the Codespace to use")
45+
portsCmd.Flags().StringVarP(&opts.codespaceName, "codespace", "c", "", "The `name` of the codespace to use")
4646
portsCmd.Flags().BoolVar(&opts.asJSON, "json", false, "Output as JSON")
4747

4848
portsCmd.AddCommand(newPortsPublicCmd())
@@ -71,7 +71,7 @@ func ports(opts *portsOptions) error {
7171
if err == codespaces.ErrNoCodespaces {
7272
return err
7373
}
74-
return fmt.Errorf("error choosing Codespace: %v", err)
74+
return fmt.Errorf("error choosing codespace: %v", err)
7575
}
7676

7777
devContainerCh := getDevContainer(ctx, apiClient, codespace)
@@ -211,12 +211,12 @@ func updatePortVisibility(log *output.Logger, codespaceName, sourcePort string,
211211

212212
token, err := apiClient.GetCodespaceToken(ctx, user.Login, codespaceName)
213213
if err != nil {
214-
return fmt.Errorf("error getting Codespace token: %v", err)
214+
return fmt.Errorf("error getting codespace token: %v", err)
215215
}
216216

217217
codespace, err := apiClient.GetCodespace(ctx, token, user.Login, codespaceName)
218218
if err != nil {
219-
return fmt.Errorf("error getting Codespace: %v", err)
219+
return fmt.Errorf("error getting codespace: %v", err)
220220
}
221221

222222
lsclient, err := codespaces.ConnectToLiveshare(ctx, log, apiClient, user.Login, token, codespace)
@@ -277,12 +277,12 @@ func forwardPorts(log *output.Logger, codespaceName string, ports []string) erro
277277

278278
token, err := apiClient.GetCodespaceToken(ctx, user.Login, codespaceName)
279279
if err != nil {
280-
return fmt.Errorf("error getting Codespace token: %v", err)
280+
return fmt.Errorf("error getting codespace token: %v", err)
281281
}
282282

283283
codespace, err := apiClient.GetCodespace(ctx, token, user.Login, codespaceName)
284284
if err != nil {
285-
return fmt.Errorf("error getting Codespace: %v", err)
285+
return fmt.Errorf("error getting codespace: %v", err)
286286
}
287287

288288
lsclient, err := codespaces.ConnectToLiveshare(ctx, log, apiClient, user.Login, token, codespace)

cmd/ghcs/ssh.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ func newSSHCmd() *cobra.Command {
2020

2121
sshCmd := &cobra.Command{
2222
Use: "ssh",
23-
Short: "SSH into a Codespace",
23+
Short: "SSH into a codespace",
2424
Args: cobra.NoArgs,
2525
RunE: func(cmd *cobra.Command, args []string) error {
2626
return ssh(context.Background(), sshProfile, codespaceName, sshServerPort)
@@ -29,7 +29,7 @@ func newSSHCmd() *cobra.Command {
2929

3030
sshCmd.Flags().StringVarP(&sshProfile, "profile", "", "", "The `name` of the SSH profile to use")
3131
sshCmd.Flags().IntVarP(&sshServerPort, "server-port", "", 0, "SSH server port number")
32-
sshCmd.Flags().StringVarP(&codespaceName, "codespace", "c", "", "The `name` of the Codespace to use")
32+
sshCmd.Flags().StringVarP(&codespaceName, "codespace", "c", "", "The `name` of the codespace to use")
3333

3434
return sshCmd
3535
}
@@ -53,7 +53,7 @@ func ssh(ctx context.Context, sshProfile, codespaceName string, localSSHServerPo
5353

5454
codespace, token, err := codespaces.GetOrChooseCodespace(ctx, apiClient, user, codespaceName)
5555
if err != nil {
56-
return fmt.Errorf("get or choose Codespace: %v", err)
56+
return fmt.Errorf("get or choose codespace: %v", err)
5757
}
5858

5959
lsclient, err := codespaces.ConnectToLiveshare(ctx, log, apiClient, user.Login, token, codespace)

0 commit comments

Comments
 (0)
X Tutup