summaryrefslogtreecommitdiff
path: root/repoNew.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-07-09 03:18:51 -0500
committerJeff Carr <[email protected]>2025-07-09 23:24:06 -0500
commitbd05270a8348ded0d48199a294797d445ba3fcb8 (patch)
treea19ba96b0a293cc05f2c90c4a81179947056a579 /repoNew.go
parentb60226c818a15ae7edc3356c595878eacc9acd17 (diff)
expose these the forge daemon
Diffstat (limited to 'repoNew.go')
-rw-r--r--repoNew.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/repoNew.go b/repoNew.go
index 5519fcb..96e5bda 100644
--- a/repoNew.go
+++ b/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+)$`