Skip to content

Commit

Permalink
Added support for nushell (#209)
Browse files Browse the repository at this point in the history
  • Loading branch information
vapenyk authored Oct 8, 2023
1 parent 099dcc3 commit 8bd88e2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
11 changes: 11 additions & 0 deletions set-java-home.nu
Original file line number Diff line number Diff line change
@@ -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
}
}

0 comments on commit 8bd88e2

Please sign in to comment.