Open Philzen opened 9 months ago
BTW it would be really nice in this situation to be able to easily load the defaults, maybe using something such as sdk use defaults
.
Hi @Philzen
The clear
mechanism currently
.sdkmanrc
fileI wonder if the whole restoring defaults
mechanism wouldn't be fixed by introducing a global .sdkmanrc
file in the $HOME
directory, like other tools do.
The env
command could then walk up the directory tree until it hits "$HOME" and look in each parent directory for an .sdkmanrc
file.
AFAIK other tools like nvm
etc. also do it that way.
Bug report When i cd into a directory with an
.sdkmanrc
, it fails to restore the defaults when leaving the directory again when the.sdkmanrc
file doesn't exist anymore by then (for instance b/c i switched to a git branch where it didn't exist yet).To reproduce
I'm using sdkman with
sdkman_auto_env=true
cd ~/cool-project
where cool-project folder currently contains an.sdkmanrc
(→ sdkman loads correct i.e. maven & java version).sdkmanrc
cd..
→ :boom:
Could not find /home/user/cool-project/.sdkmanrc.
Now checking
sdk current
reveals that the default versions have not been restored – the shell still uses the versions that SDKMAN! loaded after entering thecool-project
directory.System info