tfutils / tfenv

Terraform version manager
MIT License
4.43k stars 450 forks source link

Improve `TFENV_ARCH` initialisation for Apple Silicon Macs #351

Closed denizgenc closed 1 year ago

denizgenc commented 2 years ago

Fixes #350. I've changed the order of the uname -s and uname -m steps in order to make this work. As such, I've created a new variable, kernel, that is set during the uname -s case statement. kernel is then used when setting TFENV_ARCH when aarch-64 | arm64 is found, and also later when setting the os variable. Hope it makes sense.

I've checked this against the current tfenv installed on my machine (version 3.0.0, installed via brew), and it works where the current version fails (tfenv == 3.0.0, tfenv-deniz == this branch):

$ tfenv install 0.11.15
Installing Terraform v0.11.15
Downloading release tarball from https://releases.hashicorp.com/terraform/0.11.15/terraform_0.11.15_darwin_arm64.zip
curl: (22) The requested URL returned error: 404                                                   

Tarball download failed

$ tfenv-deniz install 0.11.15
Installing Terraform v0.11.15
Downloading release tarball from https://releases.hashicorp.com/terraform/0.11.15/terraform_0.11.15_darwin_amd64.zip
############################################################################################# 100.0%
...
aleclerc-sonrai commented 1 year ago

This looks great! Anything holding up approvals?