formatting for releases
This commit is contained in:
parent
7db8376213
commit
23b2b26643
37
human.go
37
human.go
|
@ -51,20 +51,20 @@ func (f *Forge) ConfigPrintTable() {
|
||||||
|
|
||||||
// show information while doing golang releases
|
// show information while doing golang releases
|
||||||
func (f *Forge) StandardReleaseHeader(repo *gitpb.Repo, state string) string {
|
func (f *Forge) StandardReleaseHeader(repo *gitpb.Repo, state string) string {
|
||||||
lastTag := repo.GetLastTag()
|
|
||||||
// tag := repo.NewestTag()
|
// tag := repo.NewestTag()
|
||||||
// gitAge, _ := tag.GetDate()
|
// gitAge, _ := tag.GetDate()
|
||||||
dur := repo.NewestAge()
|
dur := repo.NewestAge()
|
||||||
|
|
||||||
curname := repo.GetCurrentBranchName()
|
curname := repo.GetCurrentBranchName()
|
||||||
|
|
||||||
|
lastTag := repo.GetLastTag()
|
||||||
|
target := repo.GetTargetVersion()
|
||||||
master := repo.GetMasterVersion()
|
master := repo.GetMasterVersion()
|
||||||
user := repo.GetUserVersion()
|
user := repo.GetUserVersion()
|
||||||
target := repo.GetTargetVersion()
|
|
||||||
|
|
||||||
header := fmt.Sprintf("%-35s %5s %-10s %-10s %-10s %-20s %-20s %-15s",
|
header := fmt.Sprintf("%-35s %5s %-10s %-10s %-10s %-20s %-20s %-15s",
|
||||||
repo.GetGoPath(), shell.FormatDuration(dur), curname,
|
repo.GetGoPath(), shell.FormatDuration(dur), curname,
|
||||||
lastTag, target,
|
lastTag, target, master, user,
|
||||||
master, user,
|
|
||||||
state)
|
state)
|
||||||
return header
|
return header
|
||||||
}
|
}
|
||||||
|
@ -76,3 +76,32 @@ func ReleaseReportHeader() string {
|
||||||
"MASTER", "USER",
|
"MASTER", "USER",
|
||||||
"STATE")
|
"STATE")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (f *Forge) PrintReleaseReport() int {
|
||||||
|
var count int
|
||||||
|
|
||||||
|
log.Info(ReleaseReportHeader())
|
||||||
|
|
||||||
|
loop := f.Repos.SortByFullPath()
|
||||||
|
for loop.Scan() {
|
||||||
|
check := loop.Next()
|
||||||
|
if f.Config.IsReadOnly(check.GetGoPath()) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if check.GetLastTag() == check.GetTargetVersion() {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
count += 1
|
||||||
|
if check == nil {
|
||||||
|
log.Info("boo, you didn't git clone", check.GetGoPath())
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
var state string
|
||||||
|
if check.CheckDirty() {
|
||||||
|
state = "(dirty)"
|
||||||
|
}
|
||||||
|
log.Info(f.StandardReleaseHeader(check, state))
|
||||||
|
}
|
||||||
|
log.Info(fmt.Sprintf("total repo count = %d", count))
|
||||||
|
return count
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue