diff --git a/Makefile b/Makefile index 26cfd75..78a60fd 100644 --- a/Makefile +++ b/Makefile @@ -35,4 +35,4 @@ install: make -C forgeConfig install forgeConfig.pb.go: forgeConfig.proto - autogenpb --proto forgeConfig.proto --sort "ByPath,GoPath" --marshal ForgeConfigs + autogenpb --proto forgeConfig.proto diff --git a/forgeConfig.proto b/forgeConfig.proto index 5195b09..36230a5 100644 --- a/forgeConfig.proto +++ b/forgeConfig.proto @@ -11,7 +11,7 @@ import "google/protobuf/timestamp.proto"; // Import the well-known type for Time // for example 'zookeeper' is packaged as 'zookeeper-go' // due to the prior apache foundation project. This happens and is ok! message ForgeConfig { - string goPath = 1; // Examples: 'go.wit.com/apps/go-clone' or "~/mythings" or "/home/src/foo" + string goPath = 1; // `autogenpb:unique` // Examples: 'go.wit.com/apps/go-clone' or "~/mythings" or "/home/src/foo" bool writable = 2; // if you have write access to the repo bool readOnly = 3; // the opposite, but needed for now because I don't know what I'm doing @@ -32,7 +32,7 @@ message ForgeConfig { } // TODO: autogen 'sort', 'marshal' -message ForgeConfigs { +message ForgeConfigs { // `autogenpb:marshal` string uuid = 1; // could be useful for /usr/share/file/magic someday? string version = 2; // could be used for protobuf schema change violations? repeated ForgeConfig ForgeConfigs = 3; diff --git a/forgeConfig/main.go b/forgeConfig/main.go index b1e496c..8ca4bf9 100644 --- a/forgeConfig/main.go +++ b/forgeConfig/main.go @@ -15,7 +15,7 @@ func main() { if argv.List { f.ConfigPrintTable() - loop := f.Config.SortByPath() // get the list of forge configs + loop := f.Config.SortByGoPath() // get the list of forge configs for loop.Scan() { r := loop.Next() log.Info("repo:", r.GoPath) diff --git a/human.go b/human.go index e870524..67b7952 100644 --- a/human.go +++ b/human.go @@ -41,7 +41,7 @@ func (f *Forge) ConfigPrintTable() { panic("WTF forge == nil") } log.Info(standardHeader()) - loop := f.Config.SortByPath() + loop := f.Config.SortByGoPath() for loop.Scan() { r := loop.Next() log.Info(f.standardHeader(r)) diff --git a/repoSettings.go b/repoSettings.go index c44ea58..9b03ad1 100644 --- a/repoSettings.go +++ b/repoSettings.go @@ -15,7 +15,7 @@ import ( ) /* -func (f *Forge) SortByPath() *ForgeConfigIterator { +func (f *Forge) SortByGoPath() *ForgeConfigIterator { return f.Config.SortByPath() } */ @@ -37,7 +37,7 @@ func (all *ForgeConfigs) UpdateGoPath(name string, gopath string) bool { func (f *Forge) IsReadOnly(gopath string) bool { var match *ForgeConfig - loop := f.Config.SortByPath() // get the list of repos + loop := f.Config.SortByGoPath() // get the list of repos for loop.Scan() { r := loop.Next() if r.GoPath == gopath { @@ -98,7 +98,7 @@ func (f *Forge) DebName(gopath string) string { // get "zookeeper" from "go.wit.com/apps/zookeeper" normalBase := filepath.Base(gopath) - loop := f.Config.SortByPath() + loop := f.Config.SortByGoPath() for loop.Scan() { r := loop.Next() if r.GoPath == gopath { @@ -127,7 +127,7 @@ func (f *Forge) IsPrivate(thing string) bool { // sort by path means the simple 'match' logic // here works in the sense the last directory match // is the one that is used - loop := f.Config.SortByPath() // get the list of repos + loop := f.Config.SortByGoPath() // get the list of repos for loop.Scan() { r := loop.Next() if r.GoPath == thing { @@ -168,7 +168,7 @@ func (f *Forge) IsPrivate(thing string) bool { func (f *Forge) IsFavorite(thing string) bool { var match *ForgeConfig - loop := f.Config.SortByPath() // get the list of repos + loop := f.Config.SortByGoPath() // get the list of repos for loop.Scan() { r := loop.Next() if r.GoPath == thing {