Created
August 1, 2019 20:58
-
-
Save fieldju/c543ac1499ee07e32af8eaecedab809f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo 'This scripts downloads and installs the latest Cerberus API CLI' | |
echo 'This script requires curl and jq' | |
# Fetch the url for the latest linux version | |
ASSET_URL=$(curl -s https://api.github.com/repos/Nike-Inc/cerberus-cli/releases/latest | \ | |
jq -r '.assets[] | select(.name=="cerberus-cli-linux-amd64") | .browser_download_url') | |
echo "Found latest release at ${ASSET_URL}, downloading ..." | |
# Download the CLI | |
curl --silent --location --output /usr/local/bin/cerberus ${ASSET_URL} | |
# Make sure that it is executable | |
chmod +x /usr/local/bin/cerberus | |
echo "The Cerberus CLI has been installed to '/usr/local/bin/cerberus', ensure that /usr/local/bin is on your path" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment