(ctx *snap.Context, prompt string)
| 3179 | } |
| 3180 | |
| 3181 | func promptLine(ctx *snap.Context, prompt string) (string, error) { |
| 3182 | fmt.Fprint(ctx.Stdout(), prompt) |
| 3183 | |
| 3184 | reader := bufio.NewReader(ctx.Stdin()) |
| 3185 | line, err := reader.ReadString('\n') |
| 3186 | if errors.Is(err, io.EOF) { |
| 3187 | return strings.TrimSpace(line), nil |
| 3188 | } |
| 3189 | if err != nil { |
| 3190 | return "", err |
| 3191 | } |
| 3192 | return strings.TrimSpace(line), nil |
| 3193 | } |
| 3194 | |
| 3195 | func currentGitHubLogin() (string, error) { |
| 3196 | if _, err := exec.LookPath("gh"); err != nil { |
no outgoing calls
no test coverage detected