feat(zsh): make java_home conditional on java being installed

This commit is contained in:
2025-10-14 02:13:41 +01:00
parent bbbc990eea
commit 404c0ce7ea

View File

@@ -46,9 +46,10 @@ export GOBIN="$GOPATH/bin"
# OS-specific exports # OS-specific exports
if [[ $(uname) == "Darwin" ]]; then if [[ $(uname) == "Darwin" ]]; then
prepend_path PATH "/opt/homebrew/bin" prepend_path PATH "/opt/homebrew/bin"
export JAVA_HOME=$(/usr/libexec/java_home) if [ -n "$(/usr/libexec/java_home 2>/dev/null)" ]; then
export JAVA_HOME=$(/usr/libexec/java_home)
fi
export GEM_HOME=$HOME/.gem export GEM_HOME=$HOME/.gem
export GOROOT=$(brew --prefix golang)/libexec
prepend_path PATH "/opt/homebrew/opt/texlive/bin" prepend_path PATH "/opt/homebrew/opt/texlive/bin"
append_path PATH $GEM_HOME/bin append_path PATH $GEM_HOME/bin
fi fi