diff options
| author | Jeff Carr <[email protected]> | 2024-11-22 11:14:55 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-11-22 11:14:55 -0600 |
| commit | 5f65e4f4bed438ae30ba90ab334e0e0ab9bfdefa (patch) | |
| tree | 40f84150f475ee802b2a650c4b00f2a47f074783 /settings.go | |
| parent | 3ba652743c8f73dffb645ae574c2549f1b000466 (diff) | |
name fixups
Diffstat (limited to 'settings.go')
| -rw-r--r-- | settings.go | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/settings.go b/settings.go index afe5e8a..0e23764 100644 --- a/settings.go +++ b/settings.go @@ -10,6 +10,7 @@ package forgepb */ import ( + "path/filepath" "strings" ) @@ -108,3 +109,24 @@ func (all *Repos) IsPrivate(gopath string) bool { // otherwise, assume not private return match.Private } + +// returns the deb package +func (all *Repos) DebName(gopath string) string { + + normalBase := filepath.Base(gopath) + + loop := all.SortByPath() + for loop.Scan() { + r := loop.Repo() + if r.GoPath == gopath { + // if private is set here, then ok, otherwise + // still check if a Directory match exists + if r.DebName == "" { + return r.DebName + } else { + return normalBase + } + } + } + return normalBase +} |
