diff --git a/pre-commit-hadolint b/pre-commit-hadolint index 18baa34..ff72490 100755 --- a/pre-commit-hadolint +++ b/pre-commit-hadolint @@ -6,9 +6,17 @@ HADOLINT_PREFIX_URL="https://github.com/hadolint/hadolint/releases/download" HADOLINT_VERSION="v2.1.0" OS=$(uname -s) ARCH=$(uname -m) + +# so far, hadolint is not providing arm64 binaries +if [[ "$ARCH" = "arm64" ]]; then + # fallback to x86 and hope for runtime translation on macOS + ARCH=x86_64 +fi + HADOLINT_BINARY="hadolint-${OS}-${ARCH}" HADOLINT_URL="${HADOLINT_PREFIX_URL}/${HADOLINT_VERSION}/${HADOLINT_BINARY}" + DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" LOCAL_BINARY="${DIR}/${HADOLINT_BINARY}-${HADOLINT_VERSION}"