sdkman / sdkman-cli

The SDKMAN! Command Line Interface
https://sdkman.io
Apache License 2.0
6.08k stars 629 forks source link

Bug: 'sdk current' does not list current candidates on Git Bash #1189

Open kansasSamurai opened 1 year ago

kansasSamurai commented 1 year ago

Bug report

Issuing the command 'sdk current' does not list any candidates though they are installed and usable. This is not a huge deal but would be more convenient if it worked like the web documentation states.

To reproduce

Basic usage... run the command and observe the output. screenshot follows: p.s. This is "immediately" after installation of SDKMAN and 'sdk install' of java and maven.

image

System info

marc0der commented 1 year ago

What happens if you open a new terminal and run the same command?

kansasSamurai commented 1 year ago

@marc0der Same: image

kansasSamurai commented 1 year ago

p.s. and probably un-related but... the 'sdk current' command takes quite a while to execute. Is this known/expected? As I only have a few SDKs installed, the execution time surprises my assumptions. This is also more curiosity than anything else. I enjoy the work in this product so please don't think I'm only complaining about it :)

kansasSamurai commented 1 year ago

Update: I need to amend my original post. The issue is occuring on Git Bash/MinGW. The following screenshot is taken from another computer running Cygwin and it works as documented (so must be something local but I don't know where to start): image

marc0der commented 1 year ago

Good to know, thanks for the update. Also worth noting that this doesn't happen on Linux or macOS.

SvenGasterstaedt commented 1 year ago

Note that this probably also breaks the auto_env.

As the current list of candidate (and default is empty) sdk man fails to restore the default version.

image image image

System info Windows 10, Git Bash/MinGW GNU bash, version 5.2.15(1)-release (x86_64-pc-msys) SDKMAN! script: latest+41a2743 native: 0.2.2 (same with stable)

SvenGasterstaedt commented 1 year ago

@marc0der could this be related to the symlink check? For example in function __sdkman_is_symlink() {

Under WSL image

Under GitBash + Win10 image

SvenGasterstaedt commented 1 year ago

I just did the research and it seems that the git bash does not allowed symbolics links by default (on windows)

So in order to get that working refer to https://github.com/orgs/community/discussions/23591#discussioncomment-3241019