Skip to content

Commit 5982185

Browse files
chore: remove windows testing workaround for survey library
1 parent 35fe461 commit 5982185

File tree

1 file changed

+0
-16
lines changed

1 file changed

+0
-16
lines changed

cli/cliui/select.go

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package cliui
22

33
import (
4-
"flag"
54
"fmt"
65
"strings"
76

@@ -66,16 +65,6 @@ func RichSelect(inv *serpent.Invocation, richOptions RichSelectOptions) (*coders
6665

6766
// Select displays a list of user options.
6867
func Select(inv *serpent.Invocation, opts SelectOptions) (string, error) {
69-
// TODO: Check if this is still true for Bubbletea.
70-
// The survey library used *always* fails when testing on Windows,
71-
// as it requires a live TTY (can't be a conpty). We should fork
72-
// this library to add a dummy fallback, that simply reads/writes
73-
// to the IO provided. See:
74-
// https://github.com/AlecAivazis/survey/blob/master/terminal/runereader_windows.go#L94
75-
if flag.Lookup("test.v") != nil {
76-
return opts.Options[0], nil
77-
}
78-
7968
initialModel := selectModel{
8069
search: textinput.New(),
8170
hideSearch: opts.HideSearch,
@@ -249,11 +238,6 @@ type MultiSelectOptions struct {
249238
}
250239

251240
func MultiSelect(inv *serpent.Invocation, opts MultiSelectOptions) ([]string, error) {
252-
// Similar hack is applied to Select()
253-
if flag.Lookup("test.v") != nil {
254-
return opts.Defaults, nil
255-
}
256-
257241
options := make([]*multiSelectOption, len(opts.Options))
258242
for i, option := range opts.Options {
259243
chosen := false

0 commit comments

Comments
 (0)