mirror of
https://github.com/docker/compose.git
synced 2025-07-25 14:44:29 +02:00
Merge pull request #10657 from ndeloof/compose_project_name
don't skip `compose` used as project name
This commit is contained in:
commit
e21a8d6293
@ -62,10 +62,6 @@ func Convert(args []string) []string {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if len(arg) > 0 && arg[0] != '-' {
|
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:]...)
|
command = append(command, args[i:]...)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
@ -83,6 +83,11 @@ func Test_convert(t *testing.T) {
|
|||||||
args: []string{"--project-directory", "", "ps"},
|
args: []string{"--project-directory", "", "ps"},
|
||||||
want: []string{"compose", "--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 {
|
for _, tt := range tests {
|
||||||
t.Run(tt.name, func(t *testing.T) {
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user