@@ -109,7 +109,7 @@ func (b *Book) Checkout(step string) error {
109
109
}
110
110
printBanner ("<comment>[WEB]</> Stopping Docker Containers" , b .Debug )
111
111
if hasDocker {
112
- if err := executeCommand ([] string { "docker-compose" , "down" , "--remove-orphans" } , b .Debug , false , nil ); err != nil {
112
+ if err := executeCommand (append ( dockerComposeBin () , "down" , "--remove-orphans" ) , b .Debug , false , nil ); err != nil {
113
113
return err
114
114
}
115
115
} else {
@@ -152,7 +152,7 @@ func (b *Book) Checkout(step string) error {
152
152
153
153
printBanner ("<comment>[WEB]</> Starting Docker Compose" , b .Debug )
154
154
if hasDocker {
155
- if err := executeCommand ([] string { "docker-compose" , "up" , "-d" } , b .Debug , false , nil ); err != nil {
155
+ if err := executeCommand (append ( dockerComposeBin () , "up" , "-d" ) , b .Debug , false , nil ); err != nil {
156
156
return err
157
157
}
158
158
printBanner ("<comment>[WEB]</> Waiting for the Containers to be ready" , b .Debug )
@@ -311,3 +311,10 @@ func executeCommand(args []string, debug, skipErrors bool, env []string) error {
311
311
}
312
312
return nil
313
313
}
314
+
315
+ func dockerComposeBin () []string {
316
+ if path , err := exec .LookPath ("docker-compose" ); err == nil {
317
+ return []string {path }
318
+ }
319
+ return []string {"docker" , "compose" }
320
+ }
0 commit comments