Skip to content

Commit 3ce5288

Browse files
ndeloofglours
authored andcommitted
prompt default implementation to prevent a panic
Signed-off-by: Nicolas De Loof <[email protected]>
1 parent ac3b8fd commit 3ce5288

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pkg/compose/compose.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import (
3737
"github.com/docker/docker/api/types/volume"
3838
"github.com/docker/docker/client"
3939
"github.com/jonboulle/clockwork"
40+
"github.com/sirupsen/logrus"
4041

4142
"github.com/docker/compose/v2/pkg/api"
4243
)
@@ -63,6 +64,13 @@ func NewComposeService(dockerCli command.Cli, options ...Option) api.Compose {
6364
for _, option := range options {
6465
option(s)
6566
}
67+
if s.prompt == nil {
68+
s.prompt = func(message string, defaultValue bool) (bool, error) {
69+
fmt.Println(message)
70+
logrus.Warning("Compose is running without a 'prompt' component to interact with user")
71+
return defaultValue, nil
72+
}
73+
}
6674
return s
6775
}
6876

0 commit comments

Comments
 (0)