Adapt homebrew installation for macOS on Intel
This commit is contained in:
@@ -96,8 +96,12 @@ function getHomebrewRepositoryPath() {
|
||||
|
||||
function createBrewCallerScript() {
|
||||
ensureLocalBinFolder
|
||||
local uname_machine=$(/usr/bin/uname -m)
|
||||
local username=${homebrew_username}
|
||||
local brewCallerPath="/usr/local/bin/brew"
|
||||
local homebrewRepositoryPath="$(getHomebrewRepositoryPath)"
|
||||
local brewCallerPath="${homebrewRepositoryPath}/bin/brew-caller"
|
||||
local brewCallerSymlink="/usr/local/bin/brew"
|
||||
[[ ${uname_machine} == "arm64" ]] && brewCallerPath="${brewCallerSymlink}"
|
||||
[ -f "${brewCallerPath}" ] && rm "${brewCallerPath}"
|
||||
cat <<- BREWCALLER > ${brewCallerPath}
|
||||
#!/usr/bin/env zsh
|
||||
@@ -114,10 +118,11 @@ function createBrewCallerScript() {
|
||||
export HOMEBREW_NO_ANALYTICS_THIS_RUN=1
|
||||
export HOMEBREW_NO_ANALYTICS_MESSAGE_OUTPUT=1
|
||||
umask 002
|
||||
"$(getHomebrewRepositoryPath)/bin/brew" "\$@"
|
||||
"${homebrewRepositoryPath}/bin/brew" "\$@"
|
||||
BREWCALLER
|
||||
chown root:admin ${brewCallerPath}
|
||||
chmod ug+x,o-x ${brewCallerPath}
|
||||
[[ ${uname_machine} == "arm64" ]] || ln -s "${brewCallerPath}" "${brewCallerSymlink}"
|
||||
}
|
||||
|
||||
function createBrewPeriodicScript() {
|
||||
|
||||
Reference in New Issue
Block a user