summaryrefslogtreecommitdiff
path: root/protoc.go
diff options
context:
space:
mode:
Diffstat (limited to 'protoc.go')
-rw-r--r--protoc.go15
1 files changed, 8 insertions, 7 deletions
diff --git a/protoc.go b/protoc.go
index 5f17a19..e0c128e 100644
--- a/protoc.go
+++ b/protoc.go
@@ -33,19 +33,19 @@ import (
// --go_opt=MforgeConfig.proto=go.wit.com/apps/autogenpb/testautogen \
// forgeConfig.proto
-func (pb *Files) protocBuild(f *File) error {
+func (pb *Files) protocBuild(pf *File) error {
// read in the .proto file
- data, err := os.ReadFile(f.Filename)
+ data, err := os.ReadFile(pf.Filename)
if err != nil {
// log.Info("open config file :", err)
return err
}
- if shell.Exists(f.Pbfilename) {
- log.Info("protoc file already created", f.Pbfilename)
+ if shell.Exists(pf.Pbfilename) {
+ log.Info("protoc file already created", pf.Pbfilename)
return nil
}
- log.Info("Attempt to generate the protoc file:", f.Pbfilename)
+ log.Info("Attempt to generate the protoc file:", pf.Pbfilename)
// log.Info("go src", forge.GetGoSrc())
pwd, _ := os.Getwd()
log.Info("go.Getwd()", pwd)
@@ -60,9 +60,10 @@ func (pb *Files) protocBuild(f *File) error {
gopath := strings.TrimPrefix(pwd, argv.GoSrc)
gopath = strings.Trim(gopath, "/")
log.Info("gopath", gopath)
+ pf.GoPath = gopath
cmd := []string{"protoc", "--go_out=."}
cmd = append(cmd, "--proto_path="+gopath)
- cmd = append(cmd, "--go_opt=M"+f.Filename+"="+gopath)
+ cmd = append(cmd, "--go_opt=M"+pf.Filename+"="+gopath)
// cmd = append(cmd, "--print_free_field_numbers")
// look for included proto files
@@ -87,7 +88,7 @@ func (pb *Files) protocBuild(f *File) error {
}
}
- cmd = append(cmd, f.Filename)
+ cmd = append(cmd, pf.Filename)
log.Info("\tpwd", argv.GoSrc)
for i, s := range cmd {
log.Info("\t", i, s)