From 404c0ce7ea2bec1ba1bd08993e82442290017fe6 Mon Sep 17 00:00:00 2001 From: afranco Date: Tue, 14 Oct 2025 02:13:41 +0100 Subject: [PATCH] feat(zsh): make java_home conditional on java being installed --- .config/zsh/.zshenv | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.config/zsh/.zshenv b/.config/zsh/.zshenv index 2ff64a2..f078975 100644 --- a/.config/zsh/.zshenv +++ b/.config/zsh/.zshenv @@ -46,9 +46,10 @@ export GOBIN="$GOPATH/bin" # OS-specific exports if [[ $(uname) == "Darwin" ]]; then 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 GOROOT=$(brew --prefix golang)/libexec prepend_path PATH "/opt/homebrew/opt/texlive/bin" append_path PATH $GEM_HOME/bin fi