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{
Aliases: []string{"dc"},
Run: func(cmd *cobra.Command, args []string) {
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.DockerComposeCommand{
Command: args[0],
CommandArguments: args[1:],
Command: command,
CommandArguments: commandArgs,
HandlerOptions: exec.HandlerOptions{
Verbosity: Verbosity,
},
......
Markdown is supported
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