MCPcopy Create free account
hub / github.com/AndroidPoet/playconsole-cli / waitForEnablement

Function waitForEnablement

internal/api/enablement.go:151–170  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

149}
150
151func waitForEnablement() error {
152 fmt.Println()
153 fmt.Println("After enabling the API in Google Cloud Console:")
154 fmt.Println(" 1. Click 'ENABLE' on the API page")
155 fmt.Println(" 2. Wait a few seconds for it to activate")
156 fmt.Println()
157 fmt.Print("Press ENTER when done (or 'q' to quit): ")
158
159 reader := bufio.NewReader(os.Stdin)
160 input, _ := reader.ReadString('\n')
161 input = strings.TrimSpace(strings.ToLower(input))
162
163 if input == "q" || input == "quit" {
164 return fmt.Errorf("API enablement cancelled by user")
165 }
166
167 fmt.Println()
168 fmt.Println("Retrying...")
169 return nil
170}
171
172// openBrowser opens a URL in the default browser
173func openBrowser(url string) error {

Callers 1

HandleAPIEnablementFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected