Skip to content

Instantly share code, notes, and snippets.

@smallnest
Created December 24, 2018 09:57
Show Gist options
  • Select an option

  • Save smallnest/dfd4142fa74480174af099a4f03f2453 to your computer and use it in GitHub Desktop.

Select an option

Save smallnest/dfd4142fa74480174af099a4f03f2453 to your computer and use it in GitHub Desktop.
#!/bin/bash -e
protobuf_directories=$(find . -not -path ./.git/ -not -path ./.idea/ -type d -name "pb")
googleapis_path=$(go list -m -f '{{.Dir}}' github.com/googleapis/googleapis)
while read -r p; do
echo "generating protobuf for $p"
protoc -I. -I$googleapis_path --go_out=plugins=grpc:. $p/*.proto
done <<< "$protobuf_directories"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment