expose these the forge daemon
This commit is contained in:
parent
b60226c818
commit
bd05270a83
4
clone.go
4
clone.go
|
@ -173,6 +173,10 @@ func (f *Forge) urlClone(gopath, giturl string) (*gitpb.Repo, error) {
|
|||
// for example:
|
||||
// This will check go.wit.com for "go.wit.com/apps/go-clone"
|
||||
// and return where the URL to do git clone should be
|
||||
func FindGoImport(url string) (string, error) {
|
||||
return findGoImport(url)
|
||||
}
|
||||
|
||||
func findGoImport(url string) (string, error) {
|
||||
resp, err := http.Get(url)
|
||||
if err != nil {
|
||||
|
|
19
repoNew.go
19
repoNew.go
|
@ -35,6 +35,25 @@ func (f *Forge) NewGoRepo(gopath string, url string) (*gitpb.Repo, error) {
|
|||
return repo, nil
|
||||
}
|
||||
|
||||
// used by the forge daemon
|
||||
func (f *Forge) AddNamespaceDir(ns string, fullpath string) (*gitpb.Repo, error) {
|
||||
test := f.Repos.FindByNamespace(ns)
|
||||
if test != nil {
|
||||
return test, fmt.Errorf("already have namespace")
|
||||
}
|
||||
repo, err := f.Repos.NewGoRepo(fullpath, ns)
|
||||
if err != nil {
|
||||
log.Info("WARNING. NEW FAILED", fullpath)
|
||||
return nil, err
|
||||
}
|
||||
// slices.Reverse(f.Repos.Repos)
|
||||
|
||||
// repo.URL = url
|
||||
f.VerifyBranchNames(repo)
|
||||
repo.Reload()
|
||||
return repo, nil
|
||||
}
|
||||
|
||||
func isValidSemVer(version string) bool {
|
||||
// Regular expression for semantic versioning
|
||||
regex := `^v(\d+)\.(\d+)\.(\d+)$`
|
||||
|
|
Loading…
Reference in New Issue