Skip to content

Commit

Permalink
v4.3.1
Browse files Browse the repository at this point in the history
=====================================================================

- MacOS does some weird stuff with the homebrew prefix apparently
  • Loading branch information
wrynegade committed Apr 16, 2024
1 parent 8f3e862 commit 4146a0d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion zsh/lib/config.zsh
Original file line number Diff line number Diff line change
@@ -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')"
Expand Down

0 comments on commit 4146a0d

Please sign in to comment.