MCPcopy Index your code
hub / github.com/bootdotdev/bootdev / promptToContinue

Function promptToContinue

cmd/root.go:146–160  ·  view source on GitHub ↗
(title string, message string, prompt string)

Source from the content-addressed store, hash-verified

144}
145
146func promptToContinue(title string, message string, prompt string) bool {
147 fmt.Fprintln(os.Stderr, title)
148 fmt.Fprintln(os.Stderr, message)
149 fmt.Fprintf(os.Stderr, "%s [y/N]: ", prompt)
150
151 reader := bufio.NewReader(os.Stdin)
152 response, err := reader.ReadString('\n')
153 if err != nil {
154 fmt.Fprintln(os.Stderr)
155 return false
156 }
157
158 response = strings.TrimSpace(strings.ToLower(response))
159 return response == "y" || response == "yes"
160}
161
162// Call this function at the beginning of a command handler
163// if you need to make authenticated requests. This will

Callers 1

requireUpdatedFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected