From ba60b3e00c5f84cc0612a7906c9a413a284f606d Mon Sep 17 00:00:00 2001 From: "xiarui.xr" Date: Wed, 26 Apr 2023 19:49:53 +0800 Subject: [PATCH] fix: when the --ignore paths are contained in --focus paths, ignore that focus --- pkg/cmd/deps/options.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pkg/cmd/deps/options.go b/pkg/cmd/deps/options.go index d07f6bd4..5039b25f 100644 --- a/pkg/cmd/deps/options.go +++ b/pkg/cmd/deps/options.go @@ -128,6 +128,17 @@ func (o *DepsOptions) Run() (err error) { shouldIgnore := toSet(o.Ignore) focusPaths := toSet(o.Focus) + // 2.1 If a path in the focusPaths should be ignored, remove it from the focusPaths + for f := range shouldIgnore { + if focusPaths.contains(f) { + focusPaths.remove(f) + } + } + + if len(focusPaths) == 0 { + return nil + } + // 3. Find all the projects under the workdir var projects []*projectstack.Project if projects, err = projectstack.FindAllProjectsFrom(workDir); err != nil {