(host, user string)
| 158 | } |
| 159 | |
| 160 | func (c *Config) PromptForPassword(host, user string) (pass string) { |
| 161 | pass = os.Getenv("GITHUB_PASSWORD") |
| 162 | if pass != "" { |
| 163 | return |
| 164 | } |
| 165 | |
| 166 | ui.Printf("%s password for %s (never stored): ", host, user) |
| 167 | if ui.IsTerminal(os.Stdin) { |
| 168 | if password, err := getPassword(); err == nil { |
| 169 | pass = password |
| 170 | } |
| 171 | } else { |
| 172 | pass = c.scanLine() |
| 173 | } |
| 174 | |
| 175 | return |
| 176 | } |
| 177 | |
| 178 | func (c *Config) PromptForOTP() string { |
| 179 | fmt.Print("two-factor authentication code: ") |
no test coverage detected