Closed rahulsom closed 5 years ago
Since this project ist mostly about completion, I checked that. Seems to work as expected on my end:
As for sdk use
not doing what it's supposed to do: can confirm. Works with bash, so it's about the fish wrapper.
Fish calls bash to perform sdk
actions; I assume bash changed the version in the current (bash) shell, which then exited. This is a conceptual issue, not a programming bug. Will have to think and tinker; any input appreciated.
FWIW, sdk default
works just fine.
sdk
directly manipulates PATH
. Therefore, the solution is to copy PATH
from the bash subshell to the current shell.
Thanks for your report!
> java -version
java version "10.0.1" 2018-04-17
> sdk u java 8.0.171-oracle
Using java version 8.0.171-oracle in this shell.
> java -version
java version "1.8.0_171"
> java -version
java version "10.0.1" 2018-04-17
raphael@donald ~> sdk u java 8.0.171-oracle
Using java version 8.0.171-oracle in this shell.
> fish
Welcome to fish, the friendly interactive shell
> java -version
java version "1.8.0_171"
> java -version
java version "10.0.1" 2018-04-17
raphael@donald ~> fish
Welcome to fish, the friendly interactive shell
raphael@donald ~> sdk u java 8.0.171-oracle
Using java version 8.0.171-oracle in this shell.
raphael@donald ~> java -version
java version "1.8.0_171"
raphael@donald ~> exit
raphael@donald ~> java -version
java version "10.0.1" 2018-04-17
Nota bene: fish-sdk
now copies PATH always (as long as sdk
succeeds). I'm sure issues can be caused by that. I might also have missed some escaping or another so some PATH entries might break the script. Awaiting reports.
This could provide an alternative: https://github.com/oh-my-fish/plugin-foreign-env
This is what I see.