open-nomad/scripts/vagrant-linux-priv-buf.sh
2021-01-31 20:09:15 -05:00

27 lines
479 B
Bash
Executable file

#!/usr/bin/env bash
set -o errexit
# Make sure you grab the latest version
VERSION=0.36.0
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