Created
February 5, 2016 18:16
-
-
Save tj/4c3153392a0022c23512 to your computer and use it in GitHub Desktop.
Update terraform
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
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