mirror of https://github.com/Hilbis/Hilbish
fix: prompt for new input on error with ContinuePrompt
basically, dont disregard the error we get and dont return previous input. now we try to prompt for new input without running the previous if the function got an errorpull/61/head
parent
7a8df8b9f2
commit
419e327d95
7
main.go
7
main.go
|
@ -140,6 +140,7 @@ func main() {
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
input:
|
||||||
for interactive {
|
for interactive {
|
||||||
running = false
|
running = false
|
||||||
|
|
||||||
|
@ -162,8 +163,10 @@ func main() {
|
||||||
if strings.HasSuffix(input, "\\") {
|
if strings.HasSuffix(input, "\\") {
|
||||||
for {
|
for {
|
||||||
input, err = ContinuePrompt(strings.TrimSuffix(input, "\\"))
|
input, err = ContinuePrompt(strings.TrimSuffix(input, "\\"))
|
||||||
|
if err != nil {
|
||||||
if err != nil || !strings.HasSuffix(input, "\\") {
|
goto input // continue inside nested loop
|
||||||
|
}
|
||||||
|
if !strings.HasSuffix(input, "\\") {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue