From ad7007a8ee893070a1d766718e4ddd9da5a62035 Mon Sep 17 00:00:00 2001 From: "T. R. Bernstein" <137705289+trbernstein@users.noreply.github.com> Date: Sat, 18 Oct 2025 00:41:34 +0200 Subject: [PATCH] Clean symlinks too for brew caller script --- modules/04-install-brew.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/04-install-brew.sh b/modules/04-install-brew.sh index 69c73b7..df0bc6d 100755 --- a/modules/04-install-brew.sh +++ b/modules/04-install-brew.sh @@ -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 #include