1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-01-24 05:36:19 +02:00

additional password prompt regex

This commit is contained in:
Jesse Duffield 2020-05-15 21:54:11 +10:00
parent 1c259f69f6
commit f8dedb710b

View File

@ -132,11 +132,12 @@ func (c *OSCommand) DetectUnamePass(command string, ask func(string) string) err
ttyText = ttyText + " " + word
prompts := map[string]string{
"password": `Password\s*for\s*'.+':`,
"username": `Username\s*for\s*'.+':`,
`.+'s password:`: "password",
`Password\s*for\s*'.+':`: "password",
`Username\s*for\s*'.+':`: "username",
}
for askFor, pattern := range prompts {
for pattern, askFor := range prompts {
if match, _ := regexp.MatchString(pattern, ttyText); match {
ttyText = ""
return ask(askFor)