Skip to content

Commit c74f1b8

Browse files
author
OpenShift Bot
authored
Merge pull request #12798 from stevekuznetsov/skuznets/protobuf-better
Merged by openshift-bot
2 parents e7aaea9 + ec41e19 commit c74f1b8

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

hack/update-generated-protobuf.sh

+13-10
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
#!/bin/bash
22
source "$(dirname "${BASH_SOURCE}")/lib/init.sh"
33

4-
if ! os::util::find::system_binary 'protoc' || [[ "$(protoc --version)" != "libprotoc 3.0."* ]]; then
5-
echo "Generating protobuf requires protoc 3.0.x. Please download and"
6-
echo "install the platform appropriate Protobuf package for your OS: "
7-
echo
8-
echo " https://github.com/google/protobuf/releases"
9-
echo
10-
if [[ "${PROTO_OPTIONAL:-}" == "1" ]]; then
11-
exit 0
12-
fi
13-
exit 1
4+
if [[ "${PROTO_OPTIONAL:-}" == "1" ]]; then
5+
os::log::warn "Skipping protobuf generation as \$PROTO_OPTIONAL is set."
6+
exit 0
7+
fi
8+
9+
os::util::ensure::system_binary_exists 'protoc'
10+
if [[ "$(protoc --version)" != "libprotoc 3.0."* ]]; then
11+
os::log::fatal "Generating protobuf requires protoc 3.0.x. Please download and
12+
install the platform appropriate Protobuf package for your OS:
13+
14+
https://github.com/google/protobuf/releases
15+
16+
To skip protobuf generation, set \$PROTO_OPTIONAL."
1417
fi
1518

1619
os::util::ensure::gopath_binary_exists 'goimports'

0 commit comments

Comments
 (0)