From 48c03e6a57ef16d0cb68e436775fcc89e0f6f156 Mon Sep 17 00:00:00 2001 From: Myung Sun Kim Date: Tue, 7 Jul 2020 16:28:46 -0700 Subject: [PATCH] Update set-java-home.zsh to check directory change Update set-java-home.zsh to only update if the working directory has changed. This will prevent unnecessary java_home update. --- set-java-home.zsh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/set-java-home.zsh b/set-java-home.zsh index 2bb473cf..3a949b42 100644 --- a/set-java-home.zsh +++ b/set-java-home.zsh @@ -1,4 +1,9 @@ asdf_update_java_home() { + if [[ $L_PWD == $PWD ]]; then + return + fi + export L_PWD=$PWD + local java_path java_path="$(asdf which java)" if [[ -n "${java_path}" ]]; then