From 6d57aba702e96897985621f71c7600376157fad0 Mon Sep 17 00:00:00 2001 From: Buddy Sandidge Date: Sun, 19 Jan 2020 18:40:33 -0800 Subject: [PATCH] Add install protoc script --- bin/install-protoc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 bin/install-protoc diff --git a/bin/install-protoc b/bin/install-protoc new file mode 100755 index 0000000..4ea4b23 --- /dev/null +++ b/bin/install-protoc @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +set -x +set -e + +PROTOC_VERSION=${PROTOC_VERSION:-3.7.1} +PROTOC_ZIP=protoc-$PROTOC_VERSION-linux-x86_64.zip +TMP_DIR=$(mktemp --directory) +DEST_FILE=$TMP_DIR/$PROTOC_ZIP +URL=https://github.com/protocolbuffers/protobuf/releases/download/v$PROTOC_VERSION/$PROTOC_ZIP +curl --output "$DEST_FILE" --location $URL +sudo unzip -o "$DEST_FILE" -d /usr/local bin/protoc +sudo unzip -o "$DEST_FILE" -d /usr/local 'include/*' +rm -rfv "$TMP_DIR"