diff options
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 +} |
