From 21ff083b9bda64876df0d9b33b25b45f8f72cb90 Mon Sep 17 00:00:00 2001 From: Mike McDonald <2575327+asciimike@users.noreply.github.com> Date: Fri, 15 Oct 2021 21:56:17 +0000 Subject: [PATCH 1/4] Removing "friendly" machine name from prompt Currently the options end up as `Basic` through to `X`. No other client provides these types of names, so we should just show machine info. --- pkg/cmd/codespace/create.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pkg/cmd/codespace/create.go b/pkg/cmd/codespace/create.go index a558f4c67..70ad8928d 100644 --- a/pkg/cmd/codespace/create.go +++ b/pkg/cmd/codespace/create.go @@ -266,9 +266,7 @@ func getMachineName(ctx context.Context, apiClient apiClient, repoID int, machin machineNames := make([]string, 0, len(machines)) machineByName := make(map[string]*api.Machine) for _, m := range machines { - nameParts := camelcase.Split(m.Name) - machineName := strings.Title(strings.ToLower(nameParts[0])) - machineName = fmt.Sprintf("%s - %s", machineName, m.DisplayName) + machineName: = m.DisplayName machineNames = append(machineNames, machineName) machineByName[machineName] = m } From 5f98c9d2e4d9c444f407bb25ac2660bc20fca963 Mon Sep 17 00:00:00 2001 From: Mike McDonald <2575327+asciimike@users.noreply.github.com> Date: Fri, 15 Oct 2021 21:58:52 +0000 Subject: [PATCH 2/4] Fixing formatting --- pkg/cmd/codespace/create.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/cmd/codespace/create.go b/pkg/cmd/codespace/create.go index 70ad8928d..8f4149492 100644 --- a/pkg/cmd/codespace/create.go +++ b/pkg/cmd/codespace/create.go @@ -266,7 +266,7 @@ func getMachineName(ctx context.Context, apiClient apiClient, repoID int, machin machineNames := make([]string, 0, len(machines)) machineByName := make(map[string]*api.Machine) for _, m := range machines { - machineName: = m.DisplayName + machineName := m.DisplayName machineNames = append(machineNames, machineName) machineByName[machineName] = m } From e175d0f0a607ae7fcd863991c99bb31fe193c844 Mon Sep 17 00:00:00 2001 From: Mike McDonald <2575327+asciimike@users.noreply.github.com> Date: Fri, 15 Oct 2021 22:05:54 +0000 Subject: [PATCH 3/4] removing unused dependencies --- pkg/cmd/codespace/create.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/pkg/cmd/codespace/create.go b/pkg/cmd/codespace/create.go index 8f4149492..1858c1552 100644 --- a/pkg/cmd/codespace/create.go +++ b/pkg/cmd/codespace/create.go @@ -5,13 +5,11 @@ import ( "errors" "fmt" "os" - "strings" "github.com/AlecAivazis/survey/v2" "github.com/cli/cli/v2/internal/codespaces" "github.com/cli/cli/v2/internal/codespaces/api" "github.com/cli/cli/v2/pkg/cmd/codespace/output" - "github.com/fatih/camelcase" "github.com/spf13/cobra" ) From fadd3350dec918a92e2d1750e604e5f6bc3a47d3 Mon Sep 17 00:00:00 2001 From: Mike McDonald <2575327+asciimike@users.noreply.github.com> Date: Fri, 15 Oct 2021 22:08:41 +0000 Subject: [PATCH 4/4] Thanks CI, you the real MVP --- go.mod | 1 - go.sum | 2 -- 2 files changed, 3 deletions(-) diff --git a/go.mod b/go.mod index 5e4ef374e..70783a7eb 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,6 @@ require ( github.com/cli/safeexec v1.0.0 github.com/cpuguy83/go-md2man/v2 v2.0.1 github.com/creack/pty v1.1.16 - github.com/fatih/camelcase v1.0.0 github.com/gabriel-vasile/mimetype v1.4.0 github.com/google/go-cmp v0.5.6 github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 diff --git a/go.sum b/go.sum index d0843e74c..b41c49c40 100644 --- a/go.sum +++ b/go.sum @@ -106,8 +106,6 @@ github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5y github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/fatih/camelcase v1.0.0 h1:hxNvNX/xYBp0ovncs8WyWZrOrpBNub/JfaMvbURyft8= -github.com/fatih/camelcase v1.0.0/go.mod h1:yN2Sb0lFhZJUdVvtELVWefmrXpuZESvPmqwoZc+/fpc= github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=