Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Inline codespace slice checks
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
  • Loading branch information
BagToad and Copilot committed Aug 27, 2026
commit 4c32c17116eee7947aa8e2e4e298ff0032d2a5a6
8 changes: 2 additions & 6 deletions pkg/cmd/codespace/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,12 +245,12 @@ func (a *App) Create(ctx context.Context, opts createOptions) error {
if len(devcontainers) > 0 {

// if there is only one devcontainer.json file and it is one of the default paths we can auto-select it
if len(devcontainers) == 1 && stringInSlice(devcontainers[0].Path, DEFAULT_DEVCONTAINER_DEFINITIONS) {
if len(devcontainers) == 1 && slices.Contains(DEFAULT_DEVCONTAINER_DEFINITIONS, devcontainers[0].Path) {
devContainerPath = devcontainers[0].Path
} else {
promptOptions := []string{}

if !stringInSlice(devcontainers[0].Path, DEFAULT_DEVCONTAINER_DEFINITIONS) {
if !slices.Contains(DEFAULT_DEVCONTAINER_DEFINITIONS, devcontainers[0].Path) {
promptOptions = []string{DEVCONTAINER_PROMPT_DEFAULT}
}

Expand Down Expand Up @@ -604,7 +604,3 @@ func buildDisplayName(displayName string, prebuildAvailability string) string {
return displayName
}
}

func stringInSlice(a string, slice []string) bool {
return slices.Contains(slice, a)
}