51 lines
976 B
Go
51 lines
976 B
Go
|
package main
|
||
|
|
||
|
import (
|
||
|
"os"
|
||
|
|
||
|
"go.wit.com/dev/alexflint/arg"
|
||
|
"go.wit.com/gui"
|
||
|
"go.wit.com/lib/gui/repolist"
|
||
|
"go.wit.com/lib/protobuf/forgepb"
|
||
|
"go.wit.com/lib/protobuf/gitpb"
|
||
|
"go.wit.com/log"
|
||
|
)
|
||
|
|
||
|
// sent via ldflags
|
||
|
var VERSION string
|
||
|
|
||
|
var pp *arg.Parser
|
||
|
var forge *forgepb.Forge
|
||
|
var myGui *gui.Node
|
||
|
var rv *repolist.RepoList
|
||
|
var argvRepo *gitpb.Repo
|
||
|
|
||
|
func main() {
|
||
|
pp = arg.MustParse(&argv)
|
||
|
|
||
|
// load the ~/.config/forge/ config
|
||
|
forge = forgepb.Init()
|
||
|
// forge.ConfigPrintTable()
|
||
|
os.Setenv("REPO_WORK_PATH", forge.GetGoSrc())
|
||
|
|
||
|
myGui = gui.New()
|
||
|
myGui.Default()
|
||
|
|
||
|
repos := forge.Repos.SortByGoPath()
|
||
|
for repos.Scan() {
|
||
|
repo := repos.Next()
|
||
|
forge.VerifyBranchNames(repo)
|
||
|
fullpath := repo.GetFullPath()
|
||
|
mName := repo.GetMasterBranchName()
|
||
|
dName := repo.GetDevelBranchName()
|
||
|
uName := repo.GetUserBranchName()
|
||
|
log.Printf("repo: %-60s %-8s %-8s %-8s\n", fullpath, mName, dName, uName)
|
||
|
}
|
||
|
|
||
|
if argv.SaveConfig {
|
||
|
forge.Repos.ConfigSave()
|
||
|
}
|
||
|
|
||
|
os.Exit(0)
|
||
|
}
|