start moving things to gitpb
This commit is contained in:
parent
c25e4dd406
commit
b52c3c426a
1
clone.go
1
clone.go
|
@ -132,7 +132,6 @@ func Clone(workdir, gopath string) error {
|
|||
log.Info("trying git clone")
|
||||
log.Info("gopath =", gopath)
|
||||
|
||||
|
||||
// try a direct git clone against the gopath
|
||||
// cloneActual("helloworld", "/home/jcarr/go/src/go.wit.com/apps", "https://go.wit.com/apps/helloworld")
|
||||
if err = cloneActual(dirname, basedir, url); err == nil {
|
||||
|
|
35
common.go
35
common.go
|
@ -1,9 +1,7 @@
|
|||
package repostatus
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"unicode"
|
||||
|
||||
|
@ -61,39 +59,6 @@ func (rs *RepoStatus) IsPrimitive() bool {
|
|||
return false
|
||||
}
|
||||
|
||||
func (rs *RepoStatus) IsProtobuf() (bool, []string, error) {
|
||||
fullp, fullc, err := ScanForProtobuf(rs.Path())
|
||||
protos := make(map[string]string)
|
||||
protoc := make(map[string]string)
|
||||
var anyfound bool = false
|
||||
var allc []string
|
||||
for _, s := range fullp {
|
||||
filebase := filepath.Base(s)
|
||||
name := strings.TrimSuffix(filebase, ".proto")
|
||||
anyfound = true
|
||||
protos[name] = s
|
||||
}
|
||||
for pname, _ := range protos {
|
||||
var found bool = false
|
||||
for _, s := range fullc {
|
||||
cfilebase := filepath.Base(s)
|
||||
cname := strings.TrimSuffix(cfilebase, ".pb.go")
|
||||
protoc[cname] = s
|
||||
if cname == pname {
|
||||
found = true
|
||||
allc = append(allc, cfilebase)
|
||||
}
|
||||
}
|
||||
if found {
|
||||
// log.Info("found ok")
|
||||
} else {
|
||||
log.Info("missing compiled proto file:", pname+"pb.go")
|
||||
err = errors.New("compiled file " + pname + ".pb.go missing")
|
||||
}
|
||||
}
|
||||
return anyfound, allc, err
|
||||
}
|
||||
|
||||
// returns the filesystem path to the repo
|
||||
func (rs *RepoStatus) Path() string {
|
||||
if rs == nil {
|
||||
|
|
2
new.go
2
new.go
|
@ -4,8 +4,8 @@ import (
|
|||
"os"
|
||||
"strings"
|
||||
|
||||
"go.wit.com/lib/protobuf/gitpb"
|
||||
"go.wit.com/lib/gadgets"
|
||||
"go.wit.com/lib/protobuf/gitpb"
|
||||
"go.wit.com/log"
|
||||
)
|
||||
|
||||
|
|
24
unix.go
24
unix.go
|
@ -398,27 +398,3 @@ func ScanGitDirectories(srcDir string) []string {
|
|||
|
||||
return all
|
||||
}
|
||||
|
||||
func ScanForProtobuf(srcDir string) ([]string, []string, error) {
|
||||
var protofiles []string
|
||||
var compiled []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)
|
||||
}
|
||||
|
||||
if strings.HasSuffix(path, ".pb.go") {
|
||||
compiled = append(compiled, path)
|
||||
}
|
||||
|
||||
return nil
|
||||
})
|
||||
|
||||
return protofiles, compiled, err
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue