mirror of
https://github.com/docker/compose.git
synced 2025-11-03 21:25:21 +01:00
prompt default implementation to prevent a panic
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
parent
ac3b8fd8a5
commit
3ce52883cb
@ -37,6 +37,7 @@ import (
|
||||
"github.com/docker/docker/api/types/volume"
|
||||
"github.com/docker/docker/client"
|
||||
"github.com/jonboulle/clockwork"
|
||||
"github.com/sirupsen/logrus"
|
||||
|
||||
"github.com/docker/compose/v2/pkg/api"
|
||||
)
|
||||
@ -63,6 +64,13 @@ func NewComposeService(dockerCli command.Cli, options ...Option) api.Compose {
|
||||
for _, option := range options {
|
||||
option(s)
|
||||
}
|
||||
if s.prompt == nil {
|
||||
s.prompt = func(message string, defaultValue bool) (bool, error) {
|
||||
fmt.Println(message)
|
||||
logrus.Warning("Compose is running without a 'prompt' component to interact with user")
|
||||
return defaultValue, nil
|
||||
}
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user