diff --git a/modules/04-install-brew.sh b/modules/04-install-brew.sh index 349bb31..f66cbe7 100755 --- a/modules/04-install-brew.sh +++ b/modules/04-install-brew.sh @@ -102,12 +102,14 @@ function getHomebrewRepositoryPath() { function createBrewCallerScript() { ensureLocalBinFolder + local uname_machine=$(/usr/bin/uname -m) local username=${homebrew_username} local homebrewRepositoryPath="$(getHomebrewRepositoryPath)" local brewCallerPath="${homebrewRepositoryPath}/bin/brew-caller" local brewCallerSymlink="/usr/local/bin/brew" [[ -f "${brewCallerPath}" ]] && rm "${brewCallerPath}" [[ -f "${brewCallerSymlink}" || -h "${brewCallerSymlink}" ]] && rm "${brewCallerSymlink}" + [[ ${uname_machine} == "arm64" ]] && brewCallerPath=${brewCallerSymlink} cat <<- BREWCALLER | clang -x c -O2 -Wall -o "${brewCallerPath}" - #include #include @@ -186,7 +188,7 @@ function createBrewCallerScript() { BREWCALLER chown root:admin ${brewCallerPath} chmod 4550 ${brewCallerPath} - ln -s "${brewCallerPath}" "${brewCallerSymlink}" + [[ ${uname_machine} == "arm64" ]] || ln -s "${brewCallerPath}" "${brewCallerSymlink}" } function createBrewPeriodicScript() {