1
0
Эх сурвалжийг харах

use recently introduced `withSelectedServicesOnly` to reduce code duplication

Signed-off-by: Nicolas De Loof <[email protected]>
Nicolas De Loof 2 жил өмнө
parent
commit
8566daa96e
1 өөрчлөгдсөн 1 нэмэгдсэн , 7 устгасан
  1. 1 7
      cmd/compose/up.go

+ 1 - 7
cmd/compose/up.go

@@ -55,16 +55,10 @@ type upOptions struct {
 
 func (opts upOptions) apply(project *types.Project, services []string) error {
 	if opts.noDeps {
-		enabled, err := project.GetServices(services...)
+		err := withSelectedServicesOnly(project, services)
 		if err != nil {
 			return err
 		}
-		for _, s := range project.Services {
-			if !utils.StringContains(services, s.Name) {
-				project.DisabledServices = append(project.DisabledServices, s)
-			}
-		}
-		project.Services = enabled
 	}
 
 	if opts.exitCodeFrom != "" {