github.com/hashicorp/terraform-plugin-sdk@v1.17.2/scripts/protobuf-check.sh (about) 1 #!/usr/bin/env bash 2 3 # Check whether protobuf & go plugin are installed 4 PROTOC_HELP_URL="http://google.github.io/proto-lens/installing-protoc.html" 5 PROTOC_GEN_GO_HELP_URL="https://github.com/golang/protobuf/tree/v1.3.2#installation" 6 7 EXIT_CODE=0 8 9 which protoc >/dev/null 10 if [ $? -ne 0 ]; then 11 echo "Protocol Buffers not found." 12 echo "Please install Protocol Buffers and ensure 'protoc' is available in your PATH." 13 echo "See ${PROTOC_HELP_URL} for more." 14 echo 15 EXIT_CODE=1 16 fi 17 18 which protoc-gen-go >/dev/null 19 if [ $? -ne 0 ]; then 20 echo "Protocol Buffers Go plugin not found." 21 echo "Please install the plugin and ensure 'protoc-gen-go' is available in your PATH." 22 echo "See ${PROTOC_GEN_GO_HELP_URL} for more." 23 echo 24 EXIT_CODE=1 25 fi 26 27 exit $EXIT_CODE