Skip to content

Commit

Permalink
fix: ignore when flags not provided
Browse files Browse the repository at this point in the history
  • Loading branch information
jokestax committed Nov 1, 2024
1 parent eeed193 commit 5d93e3a
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions slice/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,17 @@ func (s *Split) parseYAMLManifest(contents []byte) (yamlFile, error) {
}
}

var groups []string
if len(s.opts.IncludedGroups) > 0 {
groups = s.opts.IncludedGroups
} else {
groups = s.opts.ExcludedGroups
}
if len(s.opts.IncludedGroups) > 0 || len(s.opts.ExcludedGroups) > 0 {
var groups []string
if len(s.opts.IncludedGroups) > 0 {
groups = s.opts.IncludedGroups
} else if len(s.opts.ExcludedGroups) > 0 {
groups = s.opts.ExcludedGroups
}

if err := checkGroup(manifest, groups, len(s.opts.IncludedGroups) > 0); err != nil {
return yamlFile{}, &skipErr{}
if err := checkGroup(manifest, groups, len(s.opts.IncludedGroups) > 0); err != nil {
return yamlFile{}, &skipErr{}
}
}

// Trim the file name
Expand Down

0 comments on commit 5d93e3a

Please sign in to comment.