diff --git a/goutils/proto_build/main.go b/goutils/proto_build/main.go index 5a47862..b81c51b 100644 --- a/goutils/proto_build/main.go +++ b/goutils/proto_build/main.go @@ -83,6 +83,10 @@ func ServiceMain() { defer createFileNotExists("protoc.sh", 0755, func(f io.Writer) error { shellstr := `#! /bin/bash +if [ ! -d "proto" ] || [ -z "$(ls -A proto)" ]; then + git submodule init + git submodule update +fi go run -gcflags="-N" proto/goutils/proto_build/main.go` f.Write([]byte(shellstr)) return nil @@ -115,6 +119,10 @@ func GenClientMain() { defer createFileNotExists("protoc.sh", 0755, func(f io.Writer) error { shellstr := `#! /bin/bash +if [ ! -d "proto" ] || [ -z "$(ls -A proto)" ]; then + git submodule init + git submodule update +fi go run -gcflags="-N" proto/goutils/proto_build/main.go client` f.Write([]byte(shellstr)) return nil