final commits before release
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
8eb7501855
commit
e6f883a9b5
|
@ -59,6 +59,15 @@ func (rs *RepoStatus) IsPrimitive() bool {
|
|||
return false
|
||||
}
|
||||
|
||||
func (rs *RepoStatus) IsProtobuf() (bool, []string, error) {
|
||||
log.Info("are there .proto files in:", rs.Path())
|
||||
all, err := ScanForProtobuf(rs.Path())
|
||||
for i, s := range all {
|
||||
log.Info("found i, s:", i, s)
|
||||
}
|
||||
return false, all, err
|
||||
}
|
||||
|
||||
// returns the filesystem path to the repo
|
||||
func (rs *RepoStatus) Path() string {
|
||||
return rs.realPath.String()
|
||||
|
|
|
@ -26,8 +26,10 @@ type RepoStatus struct {
|
|||
dirtyList string // the output from git status --porcelain
|
||||
readOnly *gadgets.OneLiner
|
||||
gitState *gadgets.OneLiner
|
||||
primitive *gadgets.OneLiner
|
||||
private *gadgets.OneLiner
|
||||
|
||||
primitive *gadgets.OneLiner // aka: doesn't have a go.sum file
|
||||
private *gadgets.OneLiner // it's not possible to publish this to pkg.go.dev
|
||||
protobuf *gadgets.OneLiner // is this repo a protobuf repo?
|
||||
|
||||
path *gadgets.OneLiner
|
||||
goSrcPath *gadgets.OneLiner
|
||||
|
|
19
unix.go
19
unix.go
|
@ -466,3 +466,22 @@ func ScanGitDirectories(srcDir string) []string {
|
|||
|
||||
return all
|
||||
}
|
||||
|
||||
func ScanForProtobuf(srcDir string) ([]string, error) {
|
||||
var protofiles []string
|
||||
err := filepath.Walk(srcDir, func(path string, info os.FileInfo, err error) error {
|
||||
if err != nil {
|
||||
log.Log(REPOWARN, "Error accessing path:", path, err)
|
||||
return err
|
||||
}
|
||||
|
||||
if strings.HasSuffix(path, ".proto") {
|
||||
//
|
||||
protofiles = append(protofiles, path)
|
||||
}
|
||||
|
||||
return nil
|
||||
})
|
||||
|
||||
return protofiles, err
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue