Closed umentu closed 2 years ago
get_arch() {
local -r machine="$(uname -m)"
local -r upper_toolname=$(echo "${toolname}" | tr '[:lower:]' '[:upper:]')
local -r tool_specific_arch_override="ASDF_HASHICORP_OVERWRITE_ARCH_${upper_toolname}"
OVERWRITE_ARCH_TOOL=${!tool_specific_arch_override:-false}
if [ $OVERWRITE_ARCH_TOOL != false ]; then
OVERWRITE_ARCH=${OVERWRITE_ARCH_TOOL}
elif [ -v $OVERWRITE_ARCH_TOOL ]; then
OVERWRITE_ARCH=$OVERWRITE_ARCH_TOOL
else
OVERWRITE_ARCH=false
fi
if [ $OVERWRITE_ARCH != false ]; then
echo "$OVERWRITE_ARCH"
elif [[ $machine == "arm64" ]] || [[ $machine == "aarch64" ]]; then
echo "arm64"
elif [[ $machine == *"arm"* ]] || [[ $machine == *"aarch"* ]]; then
echo "arm"
elif [[ $machine == *"386"* ]]; then
echo "386"
else
echo "amd64"
fi
}
OVERWRITE_ARCH_TOOL is not null, so ASDF_HASHICORP_OVERWRITE_ARCH is not applied.
https://github.com/asdf-community/asdf-hashicorp/blob/3bc5829133b9aebd4a1462a085eccebefe725946/bin/install#L120-L124