Browse Source

LookPath overwrites protoc

RPRX 5 years ago
parent
commit
25c461e072
1 changed files with 3 additions and 1 deletions
  1. 3 1
      infra/vprotogen/main.go

+ 3 - 1
infra/vprotogen/main.go

@@ -26,9 +26,11 @@ func main() {
 	}
 	protoc := "protoc" + EXE
 
-	if _, err := exec.LookPath(protoc); err != nil {
+	if path, err := exec.LookPath(protoc); err != nil {
 		fmt.Println("Make sure that you have `" + protoc + "` in your system or current path, please visit https://github.com/protocolbuffers/protobuf/releases")
 		os.Exit(1)
+	} else {
+		protoc = path
 	}
 
 	protoFilesMap := make(map[string][]string)