mirror of
https://github.com/halcyon/asdf-java.git
synced 2024-10-06 07:42:09 +08:00
Update java home on zsh using buildin function, based on https://github.com/halcyon/asdf-java/pull/136, with review comment of @halcyon
This commit is contained in:
parent
7e02348393
commit
38ca9d0bcc
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user