diff options
| author | Jeff Carr <[email protected]> | 2024-01-23 15:20:54 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-01-23 15:20:54 -0600 |
| commit | dae15b593174ed82ac0f5f8c7250cb765a2b7f64 (patch) | |
| tree | 8a826a328b34035805bb48218d12bb82a6697966 /gitConfig.go | |
| parent | 2f4cba36dddaf1b0cfeabb875527b03bdb75036b (diff) | |
Scan() everything functions
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'gitConfig.go')
| -rw-r--r-- | gitConfig.go | 27 |
1 files changed, 26 insertions, 1 deletions
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) + } + } +} |
