Skip to content

Instantly share code, notes, and snippets.

@bmritz
Last active March 23, 2023 19:11
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 bmritz/c48b092563d2d523a44ed636a1b3cb05 to your computer and use it in GitHub Desktop.
Save bmritz/c48b092563d2d523a44ed636a1b3cb05 to your computer and use it in GitHub Desktop.
make bin/terraform
UNAME_S := $(shell uname -s)
UNAME_M := $(shell uname -m)
ifeq ($(UNAME_S),Darwin)
OS := darwin
else
OS := linux
endif
ifeq ($(UNAME_M),x86_64)
ARCH := amd64
else ifeq ($(UNAME_M),arm64)
ARCH := arm64
endif
bin/terraform:
which wget || (brew install wget || apt-get install wget)
which unzip || (brew install unzip || apt-get install unzip)
mkdir -p bin
wget https://releases.hashicorp.com/terraform/0.13.5/terraform_0.13.5_$(OS)_$(ARCH).zip -O bin/terraform.zip
unzip -o bin/terraform.zip -d bin
rm bin/terraform.zip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment