diff options
| author | Jeff Carr <[email protected]> | 2024-11-27 14:08:47 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-11-27 14:08:47 -0600 |
| commit | 6dd1bba42be7264fb5437d0d7f3a037bc6096fee (patch) | |
| tree | 0de8e85c0979a8edef94eda3fb32e1cd136cc3ff /update.go | |
| parent | 2e3e4f98d33d8794a1c8a6aa13e6c9fa92fbcadb (diff) | |
fucking ya
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'update.go')
| -rw-r--r-- | update.go | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -16,7 +16,7 @@ import ( // Update version and timestamp. // returns ok (ok == true if not found) -func (r *Repo) Update(path string) error { +func (r *Repo) Update() error { // delete the old hash // r.DeleteByHash(hash) r.Refs = nil @@ -25,7 +25,7 @@ func (r *Repo) Update(path string) error { format := strings.Join(tags, "_,,,_") cmd := []string{"git", "for-each-ref", "--sort=taggerdate", "--format", format} // log.Info("RUNNING:", strings.Join(cmd, " ")) - result := shell.PathRunQuiet("", cmd) + result := shell.PathRunQuiet(r.FullPath, cmd) if result.Error != nil { log.Warn("git for-each-ref error:", result.Error) return result.Error @@ -80,7 +80,12 @@ func getGitDateStamp(gitdefault string) time.Time { return tagTime } -func (r *Repos) NewGoPath(basepath string, gopath string) *Repo { +// scans in a new git repo. If it detects the repo is a golang project, +// then it parses the go.mod/go.sum files +// TODO: try adding python, rails, perl, rust, other language things? +// I probably will never have time to try that, but I'd take patches for anyone +// that might see this note and feel so inclined. +func (r *Repos) InitNewGoPath(basepath string, gopath string) *Repo { if oldr := r.FindByPath(gopath); oldr != nil { // already had this gopath return oldr @@ -93,4 +98,5 @@ func (r *Repos) NewGoPath(basepath string, gopath string) *Repo { newr.Update() r.Append(&newr) + return &newr } |
