mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-30 03:23:08 +03:00
Removed error check for regex
Regexp only returns an error when regex string is in-corret
This commit is contained in:
@ -71,10 +71,7 @@ func (c *OSCommand) DetectUnamePass(command string, ask func(string) string) err
|
|||||||
ttyText = ttyText + " " + word
|
ttyText = ttyText + " " + word
|
||||||
|
|
||||||
// detect username question
|
// detect username question
|
||||||
detectUname, err := regexp.MatchString(`Username\s*for\s*'.+':`, ttyText)
|
detectUname, _ := regexp.MatchString(`Username\s*for\s*'.+':`, ttyText)
|
||||||
if err != nil {
|
|
||||||
return "-"
|
|
||||||
}
|
|
||||||
if detectUname {
|
if detectUname {
|
||||||
// reset the text and return the user's username
|
// reset the text and return the user's username
|
||||||
ttyText = ""
|
ttyText = ""
|
||||||
@ -82,10 +79,7 @@ func (c *OSCommand) DetectUnamePass(command string, ask func(string) string) err
|
|||||||
}
|
}
|
||||||
|
|
||||||
// detect password question
|
// detect password question
|
||||||
detectPass, err := regexp.MatchString(`Password\s*for\s*'.+':`, ttyText)
|
detectPass, _ := regexp.MatchString(`Password\s*for\s*'.+':`, ttyText)
|
||||||
if err != nil {
|
|
||||||
return "-"
|
|
||||||
}
|
|
||||||
if detectPass {
|
if detectPass {
|
||||||
// reset the text and return the user's username
|
// reset the text and return the user's username
|
||||||
ttyText = ""
|
ttyText = ""
|
||||||
|
Reference in New Issue
Block a user