Copy PATH of the sdk-running bash to the current fish.

Solves issue #8.
This commit is contained in:
Raphael Reitzig 2018-07-14 11:58:01 +02:00
parent 7bd0bb1be3
commit 11385c6385

View file

@ -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