From 4146a0d2972c11fea4e49d72fb6011e0ab750bbb Mon Sep 17 00:00:00 2001 From: yage Date: Tue, 16 Apr 2024 10:38:00 -0600 Subject: [PATCH] v4.3.1 ===================================================================== - MacOS does some weird stuff with the homebrew prefix apparently --- zsh/lib/config.zsh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/zsh/lib/config.zsh b/zsh/lib/config.zsh index 0b6b1f9..2ee5092 100644 --- a/zsh/lib/config.zsh +++ b/zsh/lib/config.zsh @@ -1,7 +1,11 @@ [[ $__SCWRYPT -eq 1 ]] && return 0 ##################################################################### -SCWRYPTS_ROOT="$(cd -- ${0:a:h}; git rev-parse --show-toplevel 2>/dev/null)" +# Apparently MacOS puts ALL of the homebrew stuff inside of a top level git repository +# with bizarre git ignores; so: +# - USE the git root if it's a manual install... +# - UNLESS that git root is just the $(brew --prefix) +SCWRYPTS_ROOT="$(cd -- ${0:a:h}; git rev-parse --show-toplevel 2>/dev/null | grep -v "^$(brew --prefix 2>/dev/null)$")" [ $SCWRYPTS_ROOT ] && [ -d "$SCWRYPTS_ROOT" ] \ || SCWRYPTS_ROOT="$(echo "${0:a:h}" | sed -n 's|\(share/scwrypts\).*$|\1|p')"