Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- if [[ -z "${1}" ]]; then
- VERSION=$(
- jq -r '. | sort_by(.created_at) | reverse | map(.tag_name) | map(select(. | test("-.+$") | not)) | first' <<< $(
- curl -s https://api.github.com/repos/hashicorp/terraform/releases
- )
- )
- else
- VERSION="${1}"
- fi
- wget -q "https://releases.hashicorp.com/terraform/${VERSION}/terraform_${VERSION}_linux_amd64.zip"
- unzip "terraform_${VERSION}_linux_amd64.zip" 1>/dev/null
- rm LICENSE.txt "terraform_${VERSION}_linux_amd64.zip" 1>/dev/null
- mv terraform /usr/local/bin
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement