Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit 22d6860

Browse files
committed
mobycli: append .exe to com.docker.cli on windows
Signed-off-by: Nick Sieger <[email protected]>
1 parent fc21528 commit 22d6860

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

cli/mobycli/exec.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import (
2424
"os/signal"
2525
"path/filepath"
2626
"regexp"
27+
"runtime"
2728

2829
"github.com/docker/compose/v2/pkg/compose"
2930
"github.com/docker/compose/v2/pkg/utils"
@@ -38,7 +39,13 @@ import (
3839
var delegatedContextTypes = []string{store.DefaultContextType}
3940

4041
// ComDockerCli name of the classic cli binary
41-
const ComDockerCli = "com.docker.cli"
42+
var ComDockerCli = "com.docker.cli"
43+
44+
func init() {
45+
if runtime.GOOS == "windows" {
46+
ComDockerCli += ".exe"
47+
}
48+
}
4249

4350
// ExecIfDefaultCtxType delegates to com.docker.cli if on moby context
4451
func ExecIfDefaultCtxType(ctx context.Context, root *cobra.Command) {

0 commit comments

Comments
 (0)