You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
705 B
Bash
22 lines
705 B
Bash
#!/usr/bin/env bash
|
|
|
|
set -x
|
|
set -e
|
|
|
|
# shellcheck disable=SC1090
|
|
source "${XDG_DATA_HOME}/buddy-up/includes/utils.sh"
|
|
|
|
PROTOC_VERSION=${PROTOC_VERSION:-3.15.6}
|
|
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 chmod 755 /usr/local/bin/protoc
|
|
sudo unzip -o "$DEST_FILE" -d /usr/local 'include/*'
|
|
sudo find /usr/local/include/google -type f -exec chmod 644 {} \;
|
|
sudo find /usr/local/include/google -type d -exec chmod 755 {} \;
|
|
rm -rfv "$TMP_DIR"
|