summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-12-04 15:35:27 -0600
committerJeff Carr <[email protected]>2024-12-04 15:35:27 -0600
commit5846d5e4affbb2c2a220453a3de3c335b43cd2d6 (patch)
tree91aee00b4965e12d38bbfaf4488dcb1535e0ca42
parentf888dab0f223ae4b41de232e941a62a46f978309 (diff)
-rw-r--r--Makefile2
-rw-r--r--main.go12
-rw-r--r--protoc.go6
3 files changed, 13 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index 9465d14..2bb0261 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
VERSION = $(shell git describe --tags)
BUILDTIME = $(shell date +%Y.%m.%d)
-run: vet build
+run: goimports vet install
vet:
@GO111MODULE=off go vet
diff --git a/main.go b/main.go
index 705b46e..52e2d31 100644
--- a/main.go
+++ b/main.go
@@ -52,6 +52,18 @@ func main() {
os.Exit(-1)
}
+ // have to figure out how to run protoc so initialize forge
+ forge = forgepb.Init()
+
+ gosrc := forge.GetGoSrc()
+ pwd, _ := os.Getwd()
+
+ if strings.HasPrefix(pwd, gosrc) {
+ log.Info("does match", pwd, "vs", gosrc)
+ } else {
+ log.Info("does not match. should exit(-1) here", pwd, "vs", gosrc)
+ }
+
if !shell.Exists("go.sum") {
shell.RunQuiet([]string{"go", "mod", "init"})
shell.RunQuiet([]string{"go", "mod", "tidy"})
diff --git a/protoc.go b/protoc.go
index acd6ad7..af7e0d1 100644
--- a/protoc.go
+++ b/protoc.go
@@ -9,7 +9,6 @@ import (
"strings"
"go.wit.com/lib/gui/shell"
- "go.wit.com/lib/protobuf/forgepb"
"go.wit.com/log"
)
@@ -31,11 +30,6 @@ func protocBuild(names map[string]string) error {
return err
}
- // have to figure out how to run protoc so initialize forge
- forge = forgepb.Init()
- // forge.ConfigPrintTable()
- os.Setenv("REPO_WORK_PATH", forge.GetGoSrc())
-
log.Info("")
if shell.Exists(names["protoc"]) {
log.Info("protoc file already created", names["protoc"])