mirror of
https://github.com/ethauvin/sdkman-for-fish.git
synced 2025-04-25 05:17:11 -07:00
Copy PATH of the sdk-running bash to the current fish.
Solves issue #8.
This commit is contained in:
parent
7bd0bb1be3
commit
11385c6385
1 changed files with 10 additions and 1 deletions
|
@ -22,6 +22,15 @@ if test -f "$sdkman_init"
|
|||
|
||||
# Declare the sdk command for fish
|
||||
function sdk
|
||||
bash -c "source $sdkman_init && sdk $argv"
|
||||
set bashEcho (bash -c "source $sdkman_init && sdk $argv && echo \"\$PATH\"")
|
||||
|
||||
# If SDKMAN! succeeded, copy PATH here (might have changed)
|
||||
if [ $status = 0 ]
|
||||
set newPath (string split : "$bashEcho[-1]")
|
||||
set -gx PATH $newPath
|
||||
end
|
||||
|
||||
# Print output of SDKMAN!
|
||||
string join \n $bashEcho[0..-2]
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue