Skip to content

Instantly share code, notes, and snippets.

@ethanhinson
Created November 17, 2019 20:52
Show Gist options
  • Save ethanhinson/549fd62be575f3a72b0fe8a94dde3961 to your computer and use it in GitHub Desktop.
Save ethanhinson/549fd62be575f3a72b0fe8a94dde3961 to your computer and use it in GitHub Desktop.
Iterate the list of .proto files in a directory recursively
#!/bin/bash
for x in $(find "$(pwd)/apis" -name '*.proto'); do
protoc -I /usr/local/include -I "$(pwd)"/apis \
-I $GOPATH/src \
--go_out=paths=source_relative,plugins=grpc:gen/go \
--grpc-gateway_out=logtostderr=true:. "$x"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment