fix(install): add error handling and minor code cleanups

Signed-off-by: Rodney Osodo <socials@rodneyosodo.com>
This commit is contained in:
Rodney Osodo
2026-02-17 08:53:40 +03:00
parent bfd5aa30a7
commit ffbea7af59
5 changed files with 67 additions and 41 deletions

View File

@@ -57,11 +57,12 @@ func readBool(reader *bufio.Reader, prompt string, defaultValue bool) bool {
for {
input := readString(reader, prompt+" (yes/no)", defaultStr)
lower := strings.ToLower(input)
if lower == "yes" {
switch lower {
case "yes":
return true
} else if lower == "no" {
case "no":
return false
} else {
default:
fmt.Println("Please enter 'yes' or 'no'.")
}
}
@@ -71,11 +72,12 @@ func readBoolNoDefault(reader *bufio.Reader, prompt string) bool {
for {
input := readStringNoDefault(reader, prompt+" (yes/no)")
lower := strings.ToLower(input)
if lower == "yes" {
switch lower {
case "yes":
return true
} else if lower == "no" {
case "no":
return false
} else {
default:
fmt.Println("Please enter 'yes' or 'no'.")
}
}