Browse Source

chore: print model attribute instead of model name used in compose file

Signed-off-by: MohammadHasan Akbari <[email protected]>
MohammadHasan Akbari 4 months ago
parent
commit
cb95910018
1 changed files with 4 additions and 2 deletions
  1. 4 2
      cmd/compose/config.go

+ 4 - 2
cmd/compose/config.go

@@ -393,8 +393,10 @@ func runModels(ctx context.Context, dockerCli command.Cli, opts configOptions) e
 	if err != nil {
 		return err
 	}
-	for n := range project.Models {
-		_, _ = fmt.Fprintln(dockerCli.Out(), n)
+	for _, model := range project.Models {
+		if model.Model != "" {
+			_, _ = fmt.Fprintln(dockerCli.Out(), model.Model)
+		}
 	}
 	return nil
 }