open-nomad/scripts/vagrant-linux-priv-buf.sh
Kris Hicks 511c2e9db2
proto: Switch to using buf (#9308)
This replaces all usage of `protoc` with `buf`. See `tools/buf/README.md` for more.
2020-11-17 07:01:48 -08:00

27 lines
479 B
Bash
Executable file

#!/usr/bin/env bash
set -o errexit
# Make sure you grab the latest version
VERSION=0.30.1
DOWNLOAD=https://github.com/bufbuild/buf/releases/download/v${VERSION}/buf-Linux-x86_64
function install() {
if command -v buf >/dev/null; then
if [ "${VERSION}" = "$(buf --version)" ] ; then
return
fi
fi
# Download
curl -sSL --fail "$DOWNLOAD" -o /tmp/buf
# make executable
chmod +x /tmp/buf
# Move buf to /usr/bin
mv /tmp/buf /usr/bin/buf
}
install