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