[zsh] Implement a homebrew-prefix function and use it when setting up fpath

# Conflicts:
#	zshrc
This commit is contained in:
Eryn Wells 2024-03-04 13:58:20 -08:00
parent a2bf66480c
commit ddf3de5a80
3 changed files with 23 additions and 3 deletions

19
zsh/func/homebrew-prefix Normal file
View file

@ -0,0 +1,19 @@
#!/usr/bin/env zsh
autoload binary_exists
function homebrew-prefix
{
if [[ -e "$SYSTEM_PARAMETERS_FILE" ]] && binary_exists jq; then
jq .parameters.homebrew_prefix.value "$SYSTEM_PARAMETERS_FILE"
return
fi
if ! binary_exists brew; then
return
fi
brew --prefix
}
homebrew-prefix "$@"