Explorar o código

don't skip `compose` used as project name

Signed-off-by: Nicolas De Loof <[email protected]>
Nicolas De Loof %!s(int64=2) %!d(string=hai) anos
pai
achega
60fe97416c
Modificáronse 2 ficheiros con 5 adicións e 4 borrados
  1. 0 4
      cmd/compatibility/convert.go
  2. 5 0
      cmd/compatibility/convert_test.go

+ 0 - 4
cmd/compatibility/convert.go

@@ -62,10 +62,6 @@ func Convert(args []string) []string {
 			continue
 		}
 		if len(arg) > 0 && arg[0] != '-' {
-			// not a top-level flag anymore, keep the rest of the command unmodified
-			if arg == compose.PluginName {
-				i++
-			}
 			command = append(command, args[i:]...)
 			break
 		}

+ 5 - 0
cmd/compatibility/convert_test.go

@@ -83,6 +83,11 @@ func Test_convert(t *testing.T) {
 			args: []string{"--project-directory", "", "ps"},
 			want: []string{"compose", "--project-directory", "", "ps"},
 		},
+		{
+			name: "compose as project name",
+			args: []string{"--project-name", "compose", "down", "--remove-orphans"},
+			want: []string{"compose", "--project-name", "compose", "down", "--remove-orphans"},
+		},
 	}
 	for _, tt := range tests {
 		t.Run(tt.name, func(t *testing.T) {