summaryrefslogtreecommitdiff
path: root/unix.go
diff options
context:
space:
mode:
Diffstat (limited to 'unix.go')
-rw-r--r--unix.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/unix.go b/unix.go
index 6c7faef..a3b1647 100644
--- a/unix.go
+++ b/unix.go
@@ -449,3 +449,26 @@ func (rs *RepoStatus) DoAll(all [][]string) bool {
}
return true
}
+
+func ScanGitDirectories(srcDir string) []string {
+ var all []string
+ err := filepath.Walk(srcDir, func(path string, info os.FileInfo, err error) error {
+ if err != nil {
+ log.Log(REPOWARN, "Error accessing path:", path, err)
+ return nil
+ }
+
+ // Check if the path is a directory and has a .git subdirectory
+ if info.IsDir() && IsGitDir(path) {
+ all = append(all, path)
+ }
+
+ return nil
+ })
+
+ if err != nil {
+ log.Log(REPOWARN, "Error walking the path:", srcDir, err)
+ }
+
+ return all
+}