FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
asdf-java/set-java-home.bash at master · awartoft/asdf-java · GitHub
awartoft
/
asdf-java
Public
forked from
halcyon/asdf-java
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
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
29 lines (26 loc) · 746 Bytes
Breadcrumbs
asdf-java
/
set-java-home.bash
Copy path
File metadata and controls
29 lines (26 loc) · 746 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
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
java_path=
"
$(
asdf which java
)
"
if
[[
-n
"
${java_path}
"
]]
;
then
export
JAVA_HOME
JAVA_HOME=
"
$(
dirname
"
$(
_asdf_java_absolute_dir_path
"
${java_path}
"
)
"
)
"
export
JDK_HOME=
${JAVA_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