protobuf 'Repos' renamed 'ForgeConfigs'

This commit is contained in:
Jeff Carr 2024-11-27 21:26:39 -06:00
parent f5ad4a7a41
commit 54a93cd5eb
3 changed files with 7 additions and 9 deletions

View File

@ -64,7 +64,7 @@ func (r *ForgeConfigs) All() *ForgeConfigIterator {
func (r *ForgeConfigs) SortByPath() *ForgeConfigIterator { func (r *ForgeConfigs) SortByPath() *ForgeConfigIterator {
packs := r.selectAllForgeConfigs() packs := r.selectAllForgeConfigs()
sort.Sort(ByForgeConfigPath(packs)) sort.Sort(byForgeConfigPath(packs))
iterator := newForgeConfigIterator(packs) iterator := newForgeConfigIterator(packs)
return iterator return iterator
@ -112,11 +112,11 @@ func (r *ForgeConfigs) Len() int {
return len(r.ForgeConfigs) return len(r.ForgeConfigs)
} }
type ByForgeConfigPath []*ForgeConfig type byForgeConfigPath []*ForgeConfig
func (a ByForgeConfigPath) Len() int { return len(a) } func (a byForgeConfigPath) Len() int { return len(a) }
func (a ByForgeConfigPath) Less(i, j int) bool { return a[i].GoPath < a[j].GoPath } func (a byForgeConfigPath) Less(i, j int) bool { return a[i].GoPath < a[j].GoPath }
func (a ByForgeConfigPath) Swap(i, j int) { a[i], a[j] = a[j], a[i] } func (a byForgeConfigPath) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
func (all *ForgeConfigs) DeleteByPath(gopath string) *ForgeConfig { func (all *ForgeConfigs) DeleteByPath(gopath string) *ForgeConfig {
forgeConfigsLock.Lock() forgeConfigsLock.Lock()

View File

@ -6,6 +6,7 @@ build:
-ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}" -ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"
./forgeConfig ./forgeConfig
FORGE_HOME=/tmp/forge ./forgeConfig FORGE_HOME=/tmp/forge ./forgeConfig
FORGE_HOME=/tmp/forge ./forgeConfig --list
install: install:
GO111MODULE=off go install \ GO111MODULE=off go install \

View File

@ -19,14 +19,11 @@ func main() {
if argv.List { if argv.List {
repos.PrintTable() repos.PrintTable()
/*
log.Info(forgepb.RepoHeader())
loop := repos.SortByPath() // get the list of repos loop := repos.SortByPath() // get the list of repos
for loop.Scan() { for loop.Scan() {
r := loop.Repo() r := loop.Next()
log.Info("repo:", r.GoPath) log.Info("repo:", r.GoPath)
} }
*/
os.Exit(0) os.Exit(0)
} }