summaryrefslogtreecommitdiff
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
parent8e73e6fd7e7af5eccfe6cc9549a6a61996a3da51 (diff)
use forge for IsPrivate() and IsReadOnly()v0.22.19
-rw-r--r--main.go30
-rw-r--r--structs.go8
2 files changed, 37 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" {
diff --git a/structs.go b/structs.go
index c77c73a..b3c1d79 100644
--- a/structs.go
+++ b/structs.go
@@ -5,6 +5,8 @@ import (
"go.wit.com/gui"
"go.wit.com/lib/gadgets"
"go.wit.com/lib/gui/repolist"
+ "go.wit.com/lib/protobuf/forgepb"
+ "go.wit.com/lib/protobuf/zoopb"
)
var me *autoType
@@ -26,6 +28,12 @@ type autoType struct {
// our view of the repositories
repos *repoWindow
+ // your customized repo preferences and settings
+ forge forgepb.Repos
+
+ // use zookeeper to get the list of installed packages
+ machine zoopb.Machine
+
// #### autotypist Global Build Options
// what to change all the branches to
// so, as a developer, you can move all the repos