Compare commits

...

2 Commits

Author SHA1 Message Date
T. R. Bernstein
d4d03b0bb3 Add HOMEBREW_PREFIX and _CELLAR env vars to brew caller 2025-10-18 00:42:09 +02:00
T. R. Bernstein
ad7007a8ee Clean symlinks too for brew caller script 2025-10-18 00:41:34 +02:00

View File

@@ -106,8 +106,8 @@ function createBrewCallerScript() {
local homebrewRepositoryPath="$(getHomebrewRepositoryPath)"
local brewCallerPath="${homebrewRepositoryPath}/bin/brew-caller"
local brewCallerSymlink="/usr/local/bin/brew"
[ -f "${brewCallerPath}" ] && rm "${brewCallerPath}"
[ -f "${brewCallerSymlink}" ] && rm "${brewCallerSymlink}"
[[ -f "${brewCallerPath}" ]] && rm "${brewCallerPath}"
[[ -f "${brewCallerSymlink}" || -h "${brewCallerSymlink}" ]] && rm "${brewCallerSymlink}"
cat <<- BREWCALLER | clang -x c -O2 -Wall -o "${brewCallerPath}" -
#include <unistd.h>
#include <sys/types.h>
@@ -158,6 +158,8 @@ function createBrewCallerScript() {
"HOMEBREW_LOGS=${homebrew_log}",
format_env("HOME", "%s"),
format_env("HOMEBREW_CASK_OPTS", "--no-quarantine %s"),
"HOMEBREW_PREFIX=${homebrewRepositoryPath}",
"HOMEBREW_CELLAR=${homebrewRepositoryPath}/Cellar",
"HOMEBREW_NO_AUTO_UPDATE=1",
"HOMEBREW_NO_ANALYTICS=1",
"HOMEBREW_NO_ANALYTICS_THIS_RUN=1",