Files
matchbox/scripts/codegen.sh
Dalton Hubble 798be8bdb8 bootcfg: Add bootcfg gRPC client and server packages
* Add standalone gRPC binary example
2016-03-04 11:31:33 -08:00

19 lines
490 B
Bash
Executable File

#!/usr/bin/env bash
# Generate Go protobuf code.
set -e
COREOS_ROOT="$GOPATH/src/"
# protobuf subpackages end in "pb"
PBUFS=$(go list ./... | grep -v /vendor | grep 'pb$')
# change into each protobuf directory
for pkg in $PBUFS ; do
abs_path=${GOPATH}/src/${pkg}
echo Generating $abs_path
pushd ${abs_path} > /dev/null
# generate protocol buffers, make other .proto files available to import
protoc --go_out=plugins=grpc:. -I=.:"${COREOS_ROOT}" *.proto
popd > /dev/null
done