remove carriage return from -clean prompt and fix broken logic (#2186)

This commit is contained in:
Andrew Clarke
2021-08-21 14:30:16 +10:00
committed by GitHub
parent bb609467dd
commit dcf94816fb

View File

@@ -23,12 +23,9 @@ func shouldContinue() bool {
return false
}
if len(text) <= 1 {
// default continue
return true
}
text = strings.TrimRight(text, "\r\n")
return strings.ToLower(text)[0] == 'y'
return len(text) == 0 || strings.ToLower(text)[0] == 'y'
}
// CleanConfig performs cleanup in the user's configuration directory