Symlink brew caller only on intel cpu
This commit is contained in:
@@ -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 <unistd.h>
|
||||
#include <sys/types.h>
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user