mirror of
https://github.com/outbackdingo/matchbox.git
synced 2026-01-27 10:19:35 +00:00
22 lines
517 B
Bash
Executable File
22 lines
517 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# USAGE: ./get-protoc bin/protoc
|
|
# Get the 'protoc' protocol buffer compiler
|
|
set -eu
|
|
|
|
DEST=${1:-"bin"}
|
|
VERSION="3.2.0"
|
|
|
|
OS=$(uname | tr A-Z a-z)
|
|
if [[ $OS == 'darwin' ]]; then
|
|
OS=osx # protoc names downloads with OSX, not darwin
|
|
fi
|
|
|
|
FILE="protoc-${VERSION}-${OS}-x86_64.zip"
|
|
URL="https://github.com/google/protobuf/releases/download/v${VERSION}/${FILE}"
|
|
|
|
mkdir -p $DEST
|
|
curl -L -# -o protoc.zip ${URL}
|
|
unzip -p protoc.zip bin/protoc > ${DEST}/protoc
|
|
chmod +x ${DEST}/protoc
|
|
rm -f protoc.zip
|