Skip to content

Instantly share code, notes, and snippets.

@tj
Created February 5, 2016 18:16

Revisions

  1. tj created this gist Feb 5, 2016.
    16 changes: 16 additions & 0 deletions update.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@

    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"
    }