Skip to content

Commit

Permalink
fix extension and keyword checks
Browse files Browse the repository at this point in the history
  • Loading branch information
selfup committed Aug 10, 2019
1 parent 24b2df0 commit 92503ee
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func (s *Scanner) Scan() error {
return err
}

if len(s.Keywords) == 0 {
if s.Keywords[0] == "" {
var foundFiles []string

for _, fileInfo := range s.MatchedFilePaths {
Expand Down Expand Up @@ -72,7 +72,7 @@ func (s *Scanner) scan(path string, info os.FileInfo, err error) error {
}

if !info.IsDir() {
if len(s.FileExtensions) == 0 {
if s.FileExtensions[0] == "" {
s.MatchedFilePaths = append(s.MatchedFilePaths, FileData{path, info})
} else {
for _, pattern := range s.FileExtensions {
Expand Down

0 comments on commit 92503ee

Please sign in to comment.