summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-03-01 21:35:42 -0600
committerJeff Carr <[email protected]>2024-03-01 21:35:42 -0600
commitde662f3b181fe85d97d4b3b249ebd1c09576c736 (patch)
tree97217123a5149e23acf51f8e77b85274f61896ae
parente3202ae1e997057702da62466ab8d61c53bca9ff (diff)
save name of the cfgfilev0.21.2
-rw-r--r--configfile.go2
-rw-r--r--newRepo.go24
-rw-r--r--scan.go26
-rw-r--r--structs.go2
4 files changed, 40 insertions, 14 deletions
diff --git a/configfile.go b/configfile.go
index ee38327..b46c5a2 100644
--- a/configfile.go
+++ b/configfile.go
@@ -7,8 +7,8 @@ import (
"path/filepath"
"strings"
- "go.wit.com/log"
"go.wit.com/lib/gui/repostatus"
+ "go.wit.com/log"
)
func (v *RepoList) InitRepoList(cfgfile string) {
diff --git a/newRepo.go b/newRepo.go
index 3892445..8c9eb77 100644
--- a/newRepo.go
+++ b/newRepo.go
@@ -192,17 +192,17 @@ func (r *RepoList) makeGuireleaserView(newRepo *RepoRow) {
newRepo.Hide()
})
/*
- newRepo.endBox.NewButton("CheckValidGoSum()", func() {
- ok, err := r.CheckValidGoSum(newRepo)
- if err != nil {
- log.Info("go mod tidy did not work err =", err)
- return
- }
- if ok {
- log.Info("repo has go.sum requirements that are clean")
- // newRepo.goState.SetText("GOOD")
- return
- }
- })
+ newRepo.endBox.NewButton("CheckValidGoSum()", func() {
+ ok, err := r.CheckValidGoSum(newRepo)
+ if err != nil {
+ log.Info("go mod tidy did not work err =", err)
+ return
+ }
+ if ok {
+ log.Info("repo has go.sum requirements that are clean")
+ // newRepo.goState.SetText("GOOD")
+ return
+ }
+ })
*/
}
diff --git a/scan.go b/scan.go
index 62033d5..7200898 100644
--- a/scan.go
+++ b/scan.go
@@ -2,10 +2,13 @@ package repolist
import (
"fmt"
+ "os"
+ "path/filepath"
"strconv"
"strings"
"go.wit.com/log"
+ "go.wit.com/lib/gui/repostatus"
)
func (r *RepoList) RegisterHideFunction(f func(*RepoRow)) {
@@ -70,3 +73,26 @@ func (r *RepoRow) NewScan() int {
return changed
}
+
+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() && repostatus.IsGitDir(path) {
+ all = append(all, path)
+ }
+
+ return nil
+ })
+
+ if err != nil {
+ log.Log(REPOWARN, "Error walking the path:", srcDir, err)
+ }
+
+ return all
+}
diff --git a/structs.go b/structs.go
index b16c29c..6af9283 100644
--- a/structs.go
+++ b/structs.go
@@ -21,7 +21,7 @@ type RepoList struct {
goSrcPwd string
allrepos map[string]*RepoRow
viewName string
- cfgfile string
+ cfgfile string
reposbox *gui.Node
reposgrid *gui.Node