on the way to somewhere
This commit is contained in:
parent
c2bd3b64be
commit
d1cc3bd09a
6
Makefile
6
Makefile
|
@ -36,6 +36,12 @@ redomod:
|
||||||
GO111MODULE= go mod init
|
GO111MODULE= go mod init
|
||||||
GO111MODULE= go mod tidy
|
GO111MODULE= go mod tidy
|
||||||
|
|
||||||
|
redomod-all:
|
||||||
|
./forge --RedoGoMod
|
||||||
|
|
||||||
|
redomod-erase:
|
||||||
|
./forge --RedoGoMod --erase
|
||||||
|
|
||||||
list: build
|
list: build
|
||||||
reset
|
reset
|
||||||
./forge --list
|
./forge --list
|
||||||
|
|
2
argv.go
2
argv.go
|
@ -21,6 +21,8 @@ type args struct {
|
||||||
Real bool `arg:"--fix" help:"fix config, save config & exit"`
|
Real bool `arg:"--fix" help:"fix config, save config & exit"`
|
||||||
Repomap string `arg:"--repomap" help:"parse a repomap from gowebd"`
|
Repomap string `arg:"--repomap" help:"parse a repomap from gowebd"`
|
||||||
Clone bool `arg:"--clone" help:"go-clone things you are missing"`
|
Clone bool `arg:"--clone" help:"go-clone things you are missing"`
|
||||||
|
Force bool `arg:"--force" help:"force redo go-clone"`
|
||||||
|
Erase bool `arg:"--erase" help:"erase"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (args) Version() string {
|
func (args) Version() string {
|
||||||
|
|
11
list.go
11
list.go
|
@ -51,13 +51,20 @@ func verifyPrint(repo *gitpb.Repo) {
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if me.forge.IsReadOnly(repo.GoPath) && !argv.ReadOnly {
|
if me.forge.IsReadOnly(repo) && !argv.ReadOnly {
|
||||||
|
if repo.ReadOnly {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
log.Info("readonly flag on repo is wrong", repo.GoPath)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
start := fmt.Sprintf("%-40s %-8s %-20s %-20s %-20s", s["gopath"], s["rtype"], s["cver"], s["mver"], s["cver"])
|
start := fmt.Sprintf("%-40s %-8s %-20s %-20s %-20s", s["gopath"], s["rtype"], s["cver"], s["mver"], s["cver"])
|
||||||
if s["url"] != "" {
|
if s["url"] != "" {
|
||||||
end += "(" + s["url"] + ") "
|
end += "(" + s["url"] + ") "
|
||||||
}
|
}
|
||||||
|
if repo.ReadOnly {
|
||||||
|
end += "(readonly) "
|
||||||
|
}
|
||||||
// end += fmt.Sprintf("(%s,%s,%s,%s) ", s["mname"], s["dname"], s["uname"], s["cname"])
|
// end += fmt.Sprintf("(%s,%s,%s,%s) ", s["mname"], s["dname"], s["uname"], s["cname"])
|
||||||
log.Info(start, end)
|
log.Info(start, end)
|
||||||
}
|
}
|
||||||
|
@ -76,7 +83,7 @@ func verify(repo *gitpb.Repo, s map[string]string) bool {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
// only verify the master branch name with read-only repos
|
// only verify the master branch name with read-only repos
|
||||||
if me.forge.IsReadOnly(repo.GoPath) {
|
if me.forge.IsReadOnly(repo) {
|
||||||
s["mver"] = repo.GetMasterVersion()
|
s["mver"] = repo.GetMasterVersion()
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
14
main.go
14
main.go
|
@ -30,9 +30,10 @@ func main() {
|
||||||
list()
|
list()
|
||||||
scan()
|
scan()
|
||||||
repomap()
|
repomap()
|
||||||
os.Exit(0)
|
|
||||||
|
|
||||||
if argv.RedoGoMod {
|
if argv.RedoGoMod {
|
||||||
|
me.forge.RillRedoGoMod()
|
||||||
|
os.Exit(0)
|
||||||
repos := me.forge.Repos.SortByGoPath()
|
repos := me.forge.Repos.SortByGoPath()
|
||||||
for repos.Scan() {
|
for repos.Scan() {
|
||||||
repo := repos.Next()
|
repo := repos.Next()
|
||||||
|
@ -40,14 +41,15 @@ func main() {
|
||||||
log.Printf("%10s %-50s", "old?", repo.GetGoPath())
|
log.Printf("%10s %-50s", "old?", repo.GetGoPath())
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if me.forge.IsReadOnly(repo.GetGoPath()) {
|
log.Printf("running on: %-50s", repo.GetGoPath())
|
||||||
log.Printf("%10s %-50s", "readonly", repo.GetGoPath())
|
if argv.Erase {
|
||||||
continue
|
repo.EraseGoMod()
|
||||||
|
} else {
|
||||||
|
repo.RedoGoMod()
|
||||||
}
|
}
|
||||||
repo.RedoGoMod()
|
|
||||||
}
|
}
|
||||||
os.Exit(0)
|
|
||||||
}
|
}
|
||||||
|
os.Exit(0)
|
||||||
|
|
||||||
me.myGui = gui.New()
|
me.myGui = gui.New()
|
||||||
me.myGui.Default()
|
me.myGui.Default()
|
||||||
|
|
|
@ -30,10 +30,13 @@ func repomap() {
|
||||||
comment = strings.Join(parts[2:], " ")
|
comment = strings.Join(parts[2:], " ")
|
||||||
}
|
}
|
||||||
repo := me.forge.Repos.FindByGoPath(gopath)
|
repo := me.forge.Repos.FindByGoPath(gopath)
|
||||||
|
if argv.Force && argv.Clone {
|
||||||
|
cmd := []string{"go-clone", "--recursive", gopath}
|
||||||
|
shell.RunRealtime(cmd)
|
||||||
|
continue
|
||||||
|
}
|
||||||
if repo == nil {
|
if repo == nil {
|
||||||
if argv.Clone {
|
if argv.Clone {
|
||||||
cmd := []string{"go-clone", "--recursive", gopath}
|
|
||||||
shell.RunRealtime(cmd)
|
|
||||||
// me.forge.Clone(gopath)
|
// me.forge.Clone(gopath)
|
||||||
} else {
|
} else {
|
||||||
log.Info(gopath, "need to clone")
|
log.Info(gopath, "need to clone")
|
||||||
|
|
Loading…
Reference in New Issue