We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8f3e862 commit 4146a0dCopy full SHA for 4146a0d
1 file changed
zsh/lib/config.zsh
@@ -1,7 +1,11 @@
1
[[ $__SCWRYPT -eq 1 ]] && return 0
2
#####################################################################
3
4
-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
5
+# with bizarre git ignores; so:
6
+# - USE the git root if it's a manual install...
7
+# - UNLESS that git root is just the $(brew --prefix)
8
+SCWRYPTS_ROOT="$(cd -- ${0:a:h}; git rev-parse --show-toplevel 2>/dev/null | grep -v "^$(brew --prefix 2>/dev/null)$")"
9
10
[ $SCWRYPTS_ROOT ] && [ -d "$SCWRYPTS_ROOT" ] \
11
|| SCWRYPTS_ROOT="$(echo "${0:a:h}" | sed -n 's|\(share/scwrypts\).*$|\1|p')"
0 commit comments