Skip to content

Instantly share code, notes, and snippets.

@tj
Created February 5, 2016 18:16
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 tj/4c3153392a0022c23512 to your computer and use it in GitHub Desktop.
Save tj/4c3153392a0022c23512 to your computer and use it in GitHub Desktop.
Update terraform
update_terraform() {
version=$1
echo "[+] updating terraform to $version"
curl -# -o /tmp/terraform.zip https://releases.hashicorp.com/terraform/$version/terraform_${version}_darwin_amd64.zip
echo "[+] unzipping archive"
unzip /tmp/terraform.zip -d /tmp/terraform
current=$(dirname $(which terraform))
echo "[+] installing to $current"
cp -fr /tmp/terraform/* $current
echo "[+] updated to $version"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment