From 5cf0c31eb736af4c54624d517430790c5616bb82 Mon Sep 17 00:00:00 2001 From: jetfir3 <95306468+jetfir3@users.noreply.github.com> Date: Sat, 3 Oct 2026 17:39:36 -0400 Subject: [PATCH] Remove command-line tools dependency --- spotx.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/spotx.sh b/spotx.sh index ef05d59..567044a 100644 --- a/spotx.sh +++ b/spotx.sh @@ -247,9 +247,13 @@ macos_autoupdate_check() { } macos_client_arch() { - archVar=$(/usr/bin/lipo -archs "${appBinary}" 2>/dev/null) - [[ "${archVar}" == "arm64" || "${archVar}" == "x86_64" ]] || { - echo -e "${red}Error:${clr} Client architecture not supported or could not be detected.\nReinstall client then try again.\n" >&2 + case "$(LC_ALL=C /usr/bin/file -b "${appBinary}" 2>/dev/null | LC_ALL=C /usr/bin/tr '[:upper:]' '[:lower:]')" in + "mach-o 64-bit executable arm64") archVar="arm64" ;; + "mach-o 64-bit executable x86_64") archVar="x86_64" ;; + *) archVar="" ;; + esac + [[ "${archVar}" ]] || { + echo -e "${red}Error:${clr} Client architecture not supported or could not be detected.\nConfirm the selected client is a readable macOS ARM64 or Intel Spotify installation.\n" >&2 exit 1 } snapshotBinary="${appPath}/Contents/Frameworks/Chromium Embedded Framework.framework/Resources/v8_context_snapshot.${archVar}.bin"