瀏覽代碼

Use project.ServiceNames() if no service specified in hash

Signed-off-by: Matthew Walowski <[email protected]>
Matthew Walowski 2 年之前
父節點
當前提交
704a9fd337
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      cmd/compose/config.go

+ 4 - 0
cmd/compose/config.go

@@ -190,6 +190,10 @@ func runHash(ctx context.Context, dockerCli command.Cli, opts configOptions) err
 		return err
 	}
 
+	if len(services) == 0 {
+		services = project.ServiceNames()
+	}
+
 	sorted := services
 	sort.Slice(sorted, func(i, j int) bool {
 		return sorted[i] < sorted[j]