Address review comments

Signed-off-by: Gabriel Féron <g@leirbag.net>
This commit is contained in:
Gabriel Féron 2022-12-15 10:47:46 +01:00 committed by Nicolas De loof
parent e4850d9c48
commit 1cb5536a2e
2 changed files with 9 additions and 3 deletions

View File

@ -68,7 +68,7 @@ func pullCommand(p *projectOptions, backend api.Service) *cobra.Command {
return cmd return cmd
} }
func FilterServices(project *types.Project, services []string) error { func withSelectedServicesOnly(project *types.Project, services []string) error {
enabled, err := project.GetServices(services...) enabled, err := project.GetServices(services...)
if err != nil { if err != nil {
return err return err
@ -90,7 +90,10 @@ func runPull(ctx context.Context, backend api.Service, opts pullOptions, service
} }
if !opts.includeDeps { if !opts.includeDeps {
FilterServices(project, services) err := withSelectedServicesOnly(project, services)
if err != nil {
return err
}
} }
return backend.Pull(ctx, project, api.PullOptions{ return backend.Pull(ctx, project, api.PullOptions{

View File

@ -58,7 +58,10 @@ func runPush(ctx context.Context, backend api.Service, opts pushOptions, service
} }
if !opts.IncludeDeps { if !opts.IncludeDeps {
FilterServices(project, services) err := withSelectedServicesOnly(project, services)
if err != nil {
return err
}
} }
return backend.Push(ctx, project, api.PushOptions{ return backend.Push(ctx, project, api.PushOptions{