github.com/anth0d/nomad@v0.0.0-20221214183521-ae3a0a2cad06/scripts/vagrant-linux-priv-buf.sh (about)

     1  #!/usr/bin/env bash
     2  
     3  set -o errexit
     4  
     5  # Make sure you grab the latest version
     6  VERSION=0.36.0
     7  DOWNLOAD=https://github.com/bufbuild/buf/releases/download/v${VERSION}/buf-Linux-x86_64
     8  
     9  function install() {
    10    if command -v buf >/dev/null; then
    11      if [ "${VERSION}" = "$(buf  --version)" ] ; then
    12        return
    13      fi
    14    fi
    15  
    16    # Download
    17    curl -sSL --fail "$DOWNLOAD" -o /tmp/buf
    18  
    19    # make executable
    20    chmod +x /tmp/buf
    21  
    22    # Move buf to /usr/bin
    23    mv /tmp/buf /usr/bin/buf
    24  }
    25  
    26  install