diff --git a/Makefile b/Makefile index 06dd2ce..ac11b12 100644 --- a/Makefile +++ b/Makefile @@ -31,10 +31,10 @@ clean: # refs.proto gitTag.pb.go: gitTag.proto - autogenpb --proto gitTag.proto --mutex + autogenpb --proto gitTag.proto goDep.pb.go: goDep.proto - autogenpb --proto goDep.proto --mutex + autogenpb --proto goDep.proto repo.pb.go: repo.proto - autogenpb --proto repo.proto --mutex + autogenpb --proto repo.proto diff --git a/gitTag.proto b/gitTag.proto index e69a25e..53eb346 100644 --- a/gitTag.proto +++ b/gitTag.proto @@ -4,6 +4,8 @@ package gitpb; import "google/protobuf/timestamp.proto"; // Import the well-known type for Timestamp +// global settings for autogenpb `autogenpb:mutex` + message GitTag { // `autogenpb:marshal` string refname = 1; // `autogenpb:unique` // tag name. treated as unique google.protobuf.Timestamp creatordate = 2; // git creatordate diff --git a/goDep.proto b/goDep.proto index 41af614..df374f5 100644 --- a/goDep.proto +++ b/goDep.proto @@ -6,6 +6,8 @@ package gitpb; import "google/protobuf/timestamp.proto"; // Import the well-known type for Timestamp +// global settings for autogenpb `autogenpb:mutex` + message GoDep { // `autogenpb:marshal` string hash = 1; // `autogenpb:unique` // md5sum/hash value from the go.sum file google.protobuf.Timestamp ctime = 2; // get the go date from 'go list' ? diff --git a/goDep.redoGoMod.go b/goDep.redoGoMod.go index ab55fa9..f15ed40 100644 --- a/goDep.redoGoMod.go +++ b/goDep.redoGoMod.go @@ -124,6 +124,9 @@ func (repo *Repo) parseGoSum() (bool, error) { return true, nil } func (repo *Repo) RepoType() string { + if repo == nil { + return "nil" + } if repo.GetGoPlugin() { return "plugin" } diff --git a/repo.proto b/repo.proto index 62609d3..c966ab9 100644 --- a/repo.proto +++ b/repo.proto @@ -9,6 +9,8 @@ import "gitTag.proto"; import "goDep.proto"; import "google/protobuf/timestamp.proto"; // Import the well-known type for Timestamp +// global settings for autogenpb `autogenpb:mutex` + message Repo { // `autogenpb:marshal` string fullPath = 1; // the actual path to the .git directory: '/home/devel/golang.org/x/tools' google.protobuf.Timestamp lastPull = 2; // last time a git pull was done diff --git a/repo.protofiles.go b/repo.protofiles.go index 2087830..eff0d82 100644 --- a/repo.protofiles.go +++ b/repo.protofiles.go @@ -80,3 +80,22 @@ func scanForProtobuf(srcDir string) ([]string, []string, error) { return protofiles, compiled, err } + +func (repo *Repo) GetProtoFiles() ([]string, error) { + var protofiles []string + err := filepath.Walk(repo.GetFullPath(), func(path string, info os.FileInfo, err error) error { + if err != nil { + log.Log(GITPBWARN, "Error accessing path:", path, err) + return err + } + + if strings.HasSuffix(path, ".proto") { + // + protofiles = append(protofiles, path) + } + + return nil + }) + + return protofiles, err +} diff --git a/shell.go b/shell.go index 2bde405..f2806d5 100644 --- a/shell.go +++ b/shell.go @@ -34,6 +34,10 @@ func (repo *Repo) RunQuiet(cmd []string) cmd.Status { return result } +func (repo *Repo) RunRealtime(cmd []string) cmd.Status { + return shell.PathRunRealtime(repo.GetFullPath(), cmd) +} + // for now, even check cmd.Exit func (repo *Repo) strictRun(cmd []string) (bool, error) { result := repo.RunQuiet(cmd)