Skip to content

Commit

Permalink
fix: when the --ignore paths are contained in --focus paths, ignore t…
Browse files Browse the repository at this point in the history
…hat focus (#332)
  • Loading branch information
amyXia1994 committed May 8, 2023
1 parent 74d50db commit 1e29e8e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pkg/cmd/deps/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 1e29e8e

Please sign in to comment.