FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
asdf-java/set-java-home.bash at master · halcyon/asdf-java · GitHub
halcyon
/
asdf-java
Public
Notifications
You must be signed in to change notification settings
Fork
105
Star
567
Code
Issues
66
Pull requests
18
Discussions
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
asdf-java
/
set-java-home.bash
Copy path
More file actions
More file actions
Latest commit
History
History
History
31 lines (28 loc) · 792 Bytes
Breadcrumbs
asdf-java
/
set-java-home.bash
Copy path
File metadata and controls
31 lines (28 loc) · 792 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
function
_asdf_java_absolute_dir_path
{
local
absolute_path
absolute_path=
"
$(
cd
-P
"
$(
dirname
"
$1
"
)
"
&&
pwd
)
"
echo
"
$absolute_path
"
}
function
_asdf_java_update_java_home()
{
local
java_path
if
java_path=
$(
asdf which java
2>&1
)
&&
[[
-n
$java_path
]]
;
then
export
JAVA_HOME
JAVA_HOME=
"
$(
dirname
"
$(
_asdf_java_absolute_dir_path
"
${java_path}
"
)
"
)
"
export
JDK_HOME=
${JAVA_HOME}
else
unset
JAVA_HOME
unset
JDK_HOME
fi
}
function
_asdf_java_prompt_command()
{
local
e=
$?
if
[[
"
${PWD}
"
==
"
${LAST_PWD}
"
]]
;
then
return
$e
fi
LAST_PWD=
"
${PWD}
"
_asdf_java_update_java_home
return
$e
}
if
!
[[
"
${PROMPT_COMMAND
:-
}
"
=~
_asdf_java_prompt_command ]]
;
then
PROMPT_COMMAND=
"
_asdf_java_prompt_command
${PROMPT_COMMAND
:
+;
$PROMPT_COMMAND
}
"
fi
Back
|
FazBrowse Home
|
New Git URL