Skip to content

Commit

Permalink
Update java home on zsh using buildin function, based on halcyon#136,…
Browse files Browse the repository at this point in the history
… with review comment of @halcyon
  • Loading branch information
delgurth committed Apr 6, 2021
1 parent 7e02348 commit 943e724
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions set-java-home.zsh
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
function absolute_dir_path {
local absolute_path
absolute_path="$( cd -P "$( dirname "$1" )" && pwd )"
echo "$absolute_path"
}

asdf_update_java_home() {
local java_path
java_path="$(asdf which java)"
if [[ -n "${java_path}" ]]; then
export JAVA_HOME
JAVA_HOME="$(dirname "$(absolute_dir_path "${java_path}")")"
JAVA_HOME="$(dirname "$(dirname "${java_path:A}")")"
fi
}

Expand Down

0 comments on commit 943e724

Please sign in to comment.