Skip to content

Commit

Permalink
fix: Don't go into subdirs if current has a .git folder
Browse files Browse the repository at this point in the history
  • Loading branch information
NoUseFreak committed Jan 2, 2024
1 parent 6fbd4a5 commit 3d3d04c
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions internal/pkg/repo/discover.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ func GetRepoPathsAsync(baseDir string, result *[]string) error {
return err
}

subdirs := []string{}
for _, entry := range entries {
if !entry.IsDir() {
continue
Expand All @@ -21,13 +22,17 @@ func GetRepoPathsAsync(baseDir string, result *[]string) error {
*result = append(*result, baseDir)
return nil
}

err := GetRepoPathsAsync(fmt.Sprintf("%s/%s", baseDir, entry.Name()), result)
if err != nil {
return err
}

subdirs = append(subdirs, entry.Name())
}

for _, subdir := range subdirs {
err := GetRepoPathsAsync(fmt.Sprintf("%s/%s", baseDir, subdir), result)
if err != nil {
return err
}
}

return nil
}

Expand Down

0 comments on commit 3d3d04c

Please sign in to comment.