mirror of
https://github.com/docker/compose.git
synced 2026-02-09 01:59:22 +08:00
use a simpler prompt implementation when we lack a terminal
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
committed by
Nicolas De loof
parent
a226d014b8
commit
f1313f3a09
@@ -33,6 +33,10 @@ func StringContains(array []string, needle string) bool {
|
||||
|
||||
// StringToBool converts a string to a boolean ignoring errors
|
||||
func StringToBool(s string) bool {
|
||||
b, _ := strconv.ParseBool(strings.ToLower(strings.TrimSpace(s)))
|
||||
s = strings.ToLower(strings.TrimSpace(s))
|
||||
if s == "y" {
|
||||
return true
|
||||
}
|
||||
b, _ := strconv.ParseBool(s)
|
||||
return b
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user