From c65aea04b1f22993ccccb31c48822aec1bcf895e Mon Sep 17 00:00:00 2001 From: Timmy6942025 Date: Fri, 27 Mar 2026 18:00:04 +0000 Subject: [PATCH] fix: use uname -m for architecture detection The HOSTTYPE/MACHTYPE environment variables can be incorrect in some environments (e.g., GitHub Codespaces), causing arm64 machines to try to run x86_64 binaries. Now prioritizes uname -m for reliable architecture detection. --- fpf | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/fpf b/fpf index a502d6a..4446266 100755 --- a/fpf +++ b/fpf @@ -48,16 +48,14 @@ main() { ;; esac - case "${HOSTTYPE:-${MACHTYPE:-}}" in + uname_m="$(uname -m 2>/dev/null || true)" + case "${uname_m}" in *x86_64*|*amd64*) uname_m="x86_64" ;; *aarch64*|*arm64*) uname_m="arm64" ;; - *) - uname_m="$(uname -m 2>/dev/null || true)" - ;; esac else uname_s="$(uname -s 2>/dev/null || true)"