Skip to content

Instantly share code, notes, and snippets.

@craigforr
Last active July 25, 2018 17:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save craigforr/7a5b1df806e7dbad8ca20c2d1375a021 to your computer and use it in GitHub Desktop.
Save craigforr/7a5b1df806e7dbad8ca20c2d1375a021 to your computer and use it in GitHub Desktop.
terraform-latest.sh - Display the download URLs for the latest version of HashiCorp Terraform
#!/bin/sh
# terraform-latest.sh - Display the download URLs for the latest version of HashiCorp Terraform
CURRENT_VERSION=$(curl -s https://checkpoint-api.hashicorp.com/v1/check/terraform | jq -r -M '.current_version')
for SUFFIX in SHA256SUMS SHA256SUMS.sig darwin_amd64.zip freebsd_386.zip freebsd_amd64.zip freebsd_arm.zip linux_386.zip linux_amd64.zip linux_arm.zip openbsd_386.zip openbsd_amd64.zip solaris_amd64.zip windows_386.zip windows_amd64.zip; do
echo "https://releases.hashicorp.com/terraform/${CURRENT_VERSION}/terraform_${CURRENT_VERSION}_${SUFFIX}"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment