use forge for IsPrivate() and IsReadOnly()
This commit is contained in:
parent
8e73e6fd7e
commit
1735ae5826
30
main.go
30
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" {
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue