From dae15b593174ed82ac0f5f8c7250cb765a2b7f64 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Tue, 23 Jan 2024 15:20:54 -0600 Subject: Scan() everything functions Signed-off-by: Jeff Carr --- gitConfig.go | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'gitConfig.go') diff --git a/gitConfig.go b/gitConfig.go index 70568bb..fcdb7ec 100644 --- a/gitConfig.go +++ b/gitConfig.go @@ -105,7 +105,7 @@ func readGitConfig(filePath string) (*GitConfig, error) { if len(parts) == 2 { line = strings.Trim(line, "[]") - currentName = strings.Trim(parts[1], "[]") + currentName = strings.Trim(parts[1], "\"") } continue } @@ -116,7 +116,10 @@ func readGitConfig(filePath string) (*GitConfig, error) { } key := strings.TrimSpace(partsNew[0]) + key = strings.TrimSuffix(key, "\"") + value := strings.TrimSpace(partsNew[1]) + value = strings.TrimSuffix(value, "\"") switch currentSection { case "core": @@ -233,3 +236,25 @@ func (rs *RepoStatus) ReadGoMod() bool { rs.goConfig = deps return true } + +func ScanGoSrc() { + log.Log(WARN, "Scanning all go.sum files") + for path, rs := range windowMap { + if rs.ReadGoMod() { + // everything is ok + } else { + log.Log(WARN, "failed reading go.sum repo:", path) + } + } +} + +func ScanGitConfig() { + for i, path := range listGitDirectories() { + filename := filepath.Join(path, ".git/config") + _, err := readGitConfig(filename) + if err != nil { + log.Log(WARN, "repo =", i, path) + log.Log(WARN, "Error reading .git/config:", err) + } + } +} -- cgit v1.2.3