2024-12-02 06:59:56 -06:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2024-12-02 15:45:06 -06:00
|
|
|
"fmt"
|
2024-12-02 06:59:56 -06:00
|
|
|
"os"
|
|
|
|
|
|
|
|
"go.wit.com/log"
|
|
|
|
)
|
|
|
|
|
|
|
|
func list() {
|
|
|
|
if argv.ListConf {
|
|
|
|
me.forge.ConfigPrintTable()
|
|
|
|
os.Exit(0)
|
|
|
|
}
|
|
|
|
|
|
|
|
if argv.List {
|
|
|
|
repos := me.forge.Repos.SortByGoPath()
|
|
|
|
for repos.Scan() {
|
|
|
|
repo := repos.Next()
|
2024-12-02 15:45:06 -06:00
|
|
|
var rtype string
|
2024-12-02 06:59:56 -06:00
|
|
|
if !repo.IsValid() {
|
2024-12-02 15:45:06 -06:00
|
|
|
rtype = "rm?"
|
2024-12-02 06:59:56 -06:00
|
|
|
continue
|
2024-12-02 15:45:06 -06:00
|
|
|
} else {
|
|
|
|
rtype = repo.RepoType()
|
2024-12-02 06:59:56 -06:00
|
|
|
}
|
2024-12-02 15:45:06 -06:00
|
|
|
if me.forge.IsReadOnly(repo.GetGoPath()) {
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
var end string
|
|
|
|
if repo.CheckDirty() {
|
|
|
|
end += "(dirty) "
|
|
|
|
}
|
|
|
|
mver := repo.GetMasterVersion()
|
|
|
|
dver := repo.GetDevelVersion()
|
|
|
|
uver := repo.GetUserVersion()
|
|
|
|
s := fmt.Sprintf("%-50s %-8s %-10s %-10s %-10s", repo.GetGoPath(), rtype, mver, dver, uver)
|
|
|
|
log.Info(s, end)
|
2024-12-02 06:59:56 -06:00
|
|
|
}
|
|
|
|
os.Exit(0)
|
|
|
|
}
|
|
|
|
|
|
|
|
if argv.GetMine {
|
|
|
|
log.Printf("get mine %s", me.forge.GetGoSrc())
|
|
|
|
os.Exit(0)
|
|
|
|
}
|
|
|
|
|
|
|
|
if argv.GetFav {
|
|
|
|
log.Printf("get favorites")
|
|
|
|
os.Exit(0)
|
|
|
|
}
|
|
|
|
}
|