Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update of TGENV_ARCH for linux/arm64 (Apple Silicon) users #40

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 31 additions & 7 deletions libexec/tgenv-install
Original file line number Diff line number Diff line change
Expand Up @@ -37,24 +37,48 @@ if [ -f "${dst_path}/terragrunt" ]; then
exit 0
fi

TGENV_ARCH="${TGENV_ARCH:-amd64}"
# Add support of ARM64 for Linux & Apple Silicon
case "$(uname -m)" in
aarch64* | arm64*)
# There is no arm64 support for versions:
# < 0.11.15
# >= 0.12.0, < 0.12.30
# >= 0.13.0, < 0.13.5
if [[ "${version}" =~ 0\.(([0-9]|10))\.\d* ||
"${version}" =~ 0\.11\.(([0-9]|1[0-4]))$ ||
"${version}" =~ 0\.12\.(([0-9]|[1-2][0-9]))$ ||
"${version}" =~ 0\.13\.[0-4]$
]]; then
TGENV_ARCH="${TGENV_ARCH:-amd64}";
else
TGENV_ARCH="${TGENV_ARCH:-arm64}";
fi;
;;
*)
TGENV_ARCH="${TGENV_ARCH:-amd64}";
;;
esac;

case "$(uname -s)" in
Darwin*)
os="darwin_${TGENV_ARCH}"
os="darwin_${TGENV_ARCH}";
;;
MINGW64*)
os="windows_${TGENV_ARCH}"
os="windows_${TGENV_ARCH}";
;;
MSYS_NT*)
os="windows_${TGENV_ARCH}"
os="windows_${TGENV_ARCH}";
;;
CYGWIN_NT*)
os="windows_${TGENV_ARCH}"
os="windows_${TGENV_ARCH}";
;;
FreeBSD*)
os="freebsd_${TGENV_ARCH}";
;;
*)
os="linux_${TGENV_ARCH}"
os="linux_${TGENV_ARCH}";
;;
esac
esac;

version_url="https://github.com/gruntwork-io/terragrunt/releases/download/v${version}"

Expand Down