You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)
delete .sdkmanrc
cd..
→ 💥 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 the cool-project directory.
System info
→ Linux mymachine-user 6.1.53-1-MANJARO #1 SMP PREEMPT_DYNAMIC Wed Sep 13 14:10:57 UTC 2023 x86_64 GNU/Linux
→ GNU bash, version 5.1.16(1)-release (x86_64-pc-linux-gnu)
→ SDKMAN!
script: 5.18.2
native: 0.4.2
The text was updated successfully, but these errors were encountered:
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.
Philzen
changed the title
Bug: Restoring default env breaks when .sdkenvrc is gone on folder exit
Bug: Restoring default env breaks when .sdkmanrc is gone on folder exit
Sep 26, 2023
use the candidates in the file to reset them to their defaults
I 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..
→ 💥
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
The text was updated successfully, but these errors were encountered: