mirror of
https://github.com/docker/compose.git
synced 2026-08-04 14:47:40 +00: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:
parent
a226d014b8
commit
f1313f3a09
3 changed files with 62 additions and 35 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue