Skip to content

Commit

Permalink
Merge pull request #3402 from justinsb/support_generate_proto_on_mac
Browse files Browse the repository at this point in the history
chore: allow generate-proto.sh to install protoc on mac
  • Loading branch information
google-oss-prow[bot] authored Dec 18, 2024
2 parents 0f98784 + 999bc21 commit 827a616
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions dev/tools/controllerbuilder/generate-proto.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,17 @@ GOOGLEAPI_VERSION=$(grep https://github.com/googleapis/googleapis ${REPO_ROOT}/m
cd ${REPO_ROOT}/.build/third_party
git clone https://github.com/googleapis/googleapis.git ${THIRD_PARTY}/googleapis || (cd ${THIRD_PARTY}/googleapis && git reset --hard ${GOOGLEAPI_VERSION})

which protoc || sudo apt install -y protobuf-compiler
# On mac:
# sudo brew install protobuf
if (which protoc); then
echo "Found protoc version $(protoc --version)"
else
echo "Installing protoc"
if [ "$(uname)" == "Darwin" ]; then
brew install protobuf
else
sudo apt install -y protobuf-compiler
fi
fi


protoc --include_imports --include_source_info \
-I ${THIRD_PARTY}/googleapis/ \
Expand Down

0 comments on commit 827a616

Please sign in to comment.