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