aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/terraform23
1 files changed, 20 insertions, 3 deletions
diff --git a/bin/terraform b/bin/terraform
index ac2d331..d90a3d8 100755
--- a/bin/terraform
+++ b/bin/terraform
@@ -2,10 +2,27 @@
set -euo pipefail
-basedir=$(dirname "$0")
+version=1.3.6
-terraform_version=1.0.7
-terraform_url=https://releases.hashicorp.com/terraform/$terraform_version/terraform_${terraform_version}_linux_amd64.zip
+basedir="${0%/*}"
+
+s=$(uname -s)
+case "$s"
+in
+ Darwin) s=darwin ;;
+ Linux) s=linux ;;
+ *) echo "Unsupported system: $s" >/dev/stderr ;;
+esac
+
+m=$(uname -m)
+case "$m"
+in
+ x86_64) m=amd64 ;;
+ arm64) ;;
+ *) echo "Unsupported machine: $m" >/dev/stderr ;;
+esac
+
+url=https://releases.hashicorp.com/terraform/${version}/terraform_${version}_${s}_${m}.zip
bin="$basedir/.tmp/$version/terraform"