Commit 872b1a88 authored by Addshore's avatar Addshore 🏄 Committed by Addshore
Browse files

dev: Don't break if no arguments passed to docker-compose command

Bug: T290668
parent 595b04a7
...@@ -28,10 +28,21 @@ var mwddDockerComposeCmd = &cobra.Command{ ...@@ -28,10 +28,21 @@ var mwddDockerComposeCmd = &cobra.Command{
Aliases: []string{"dc"}, Aliases: []string{"dc"},
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
mwdd.DefaultForUser().EnsureReady() mwdd.DefaultForUser().EnsureReady()
// This could be simpiler if the mwdd.DockerComposeCommand function just took a list of strings...
command := ""
if len(args) >= 1 {
command = args[0]
}
commandArgs := []string{}
if len(args) > 1 {
commandArgs = args[1:]
}
mwdd.DefaultForUser().DockerComposeTTY( mwdd.DefaultForUser().DockerComposeTTY(
mwdd.DockerComposeCommand{ mwdd.DockerComposeCommand{
Command: args[0], Command: command,
CommandArguments: args[1:], CommandArguments: commandArgs,
HandlerOptions: exec.HandlerOptions{ HandlerOptions: exec.HandlerOptions{
Verbosity: Verbosity, Verbosity: Verbosity,
}, },
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment