diff options
| author | Jeff Carr <[email protected]> | 2024-12-18 17:59:20 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-12-18 17:59:20 -0600 |
| commit | 4582a76081814fa8bc573ad003c132d41347d6f4 (patch) | |
| tree | aebee4a0424b121ac5f57dabc6e7b252ca30b773 /repoNew.go | |
| parent | 24c96ccaa7270f87da0c3bc17629de74b0da334c (diff) | |
finally re-organize and rename Clone to GoClone()v0.0.39
Diffstat (limited to 'repoNew.go')
| -rw-r--r-- | repoNew.go | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -143,6 +143,28 @@ func (f *Forge) FindByGoPath(gopath string) *gitpb.Repo { return f.Repos.FindByFullPath(fullpath) } +// tries any parent +func (f *Forge) FindAnyPath(dir string) *gitpb.Repo { + dir = filepath.Clean(dir) + repo := f.Repos.FindByFullPath(dir) + if repo != nil { + log.Info("FindAnyPath() worked = ", dir) + return repo + } + if dir == "" { + return nil + } + if dir == "/" { + return nil + } + basedir, newdir := filepath.Split(dir) + if newdir == "" { + // is this correct? not sure what stupid windows does + return nil + } + return f.FindAnyPath(basedir) +} + func (f *Forge) DeleteByGoPath(gopath string) bool { fullpath := filepath.Join(f.GetGoSrc(), gopath) return f.Repos.DeleteByFullPath(fullpath) |
