summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-11-22 08:41:37 -0600
committerJeff Carr <[email protected]>2024-11-22 08:41:37 -0600
commit1735ae5826f9c5d52ca09c78cad9d6f22f69d7de (patch)
tree2f464fa0bc141d8bb06d85c8e01ec0f334057d03 /main.go
parent8e73e6fd7e7af5eccfe6cc9549a6a61996a3da51 (diff)
use forge for IsPrivate() and IsReadOnly()v0.22.19
Diffstat (limited to 'main.go')
-rw-r--r--main.go30
1 files changed, 29 insertions, 1 deletions
diff --git a/main.go b/main.go
index d4548b5..ff0e7a8 100644
--- a/main.go
+++ b/main.go
@@ -22,6 +22,18 @@ var myargs argv
func main() {
me = new(autoType)
+ // load the ~/.config/forge/ config
+ if err := me.forge.ConfigLoad(); err != nil {
+ log.Warn("forgepb.ConfigLoad() failed", err)
+ os.Exit(-1)
+ }
+
+ // load the ~/.config/forge/ machine file from zoopb
+ if err := me.machine.ConfigLoad(); err != nil {
+ log.Warn("zoopb.ConfigLoad() failed", err)
+ os.Exit(-1)
+ }
+
// parse the command line
arg.MustParse(&myargs)
@@ -110,12 +122,28 @@ func main() {
// TODO: should not really be necessary directly after init()
me.repos.View.ScanRepositories()
+
+ loop := me.repos.View.ReposSortByName()
+ for loop.Scan() {
+ repo := loop.Repo()
+ if me.forge.IsReadOnly(repo.GoPath()) {
+ repo.Status.SetReadOnly(true)
+ } else {
+ repo.Status.SetReadOnly(false)
+ }
+ if me.forge.IsPrivate(repo.GoPath()) {
+ repo.Status.SetPrivate(true)
+ } else {
+ repo.Status.SetPrivate(false)
+ }
+ }
+
// the repo from the command line
// var myrepo *repolist.RepoRow
// find myself. the guireleaser directory is used as a working scratchpad
// for running go commands that can mess up the go.* files
- loop := me.repos.View.ReposSortByName()
+ loop = me.repos.View.ReposSortByName()
for loop.Scan() {
repo := loop.Repo()
if repo.GoPath() == "go.wit.com/apps/guireleaser" {