Added support for nushell (#209)

This commit is contained in:
Alexender Yatsenko 2023-10-08 19:55:15 +03:00 committed by GitHub
parent 099dcc36fa
commit 8bd88e2422
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 0 deletions

View File

@ -77,6 +77,10 @@ For fish shell, instead use:
`. ~/.asdf/plugins/java/set-java-home.fish`
For nushell shell, instead use:
`source ~/.asdf/plugins/java/set-java-home.nu`
For xonsh shell, instead use:
`source ~/.asdf/plugins/java/set-java-home.xsh`

11
set-java-home.nu Normal file
View File

@ -0,0 +1,11 @@
def asdf_update_java_home [] {
let $java_path = (asdf which java)
if $java_path {
let $full_path = (realpath $java_path | lines | nth 0 | str trim)
let $java_home = ($full_path | path dirname | path dirname)
let-env JAVA_HOME = $java_home
let-env JDK_HOME = $java_home
}
}