some docs

This commit is contained in:
2022-02-16 08:22:33 +01:00
parent 47f0fb6c66
commit 2631aada64
2 changed files with 31 additions and 20 deletions

View File

@@ -7,15 +7,18 @@ import (
type PKGBUILD string
// FullRepo returns full-repo from PKGBUILD'S path
func (p PKGBUILD) FullRepo() string {
sPkgbuild := strings.Split(string(p), string(filepath.Separator))
return sPkgbuild[len(sPkgbuild)-2]
}
// Repo returns repo from PKGBUILD's path
func (p PKGBUILD) Repo() string {
return strings.Split(p.FullRepo(), "-")[0]
}
// PkgBase returns pkgbase from PKGBUILD's path
func (p PKGBUILD) PkgBase() string {
sPkgbuild := strings.Split(string(p), string(filepath.Separator))
return sPkgbuild[len(sPkgbuild)-4]