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
So it turns out that sdkman expects some user configuration variables to be set, and treat them as the default settings. But it may not be a good idea to change the user's config file unattendedly during a self-update or on installation.
I'm 100% against assuming everyone will have this set in their config files. For example, I manage my dotfiles using another
program, so I'm the one who makes changes to it. If later in the future sdkman introduces new config variables, I would miss it as my dotfiles manager would override it with my own wrote config again.
I think there are 2 different things that should not be mixed:
Default settings
User preferences (the ~/.sdkman/etc/config file)
And I don't think sdkman should make changes unattended(ly) to the user preferences, but only to the default settings. Just like Git (~/.gitconfig) or any other tool.
So my proposal is:
Have the ~/.sdkman/etc/config as the default configuration source. This file can be included in this repository, and it does not need to be primed during an installation or dynamically updated during a self-update. An update of SDKMAN will contain the file, just like the other files.
Inside of this file, all the possible configuration variables will be set with their default values (some of them can be removed from sdkman-init.sh thus, such as the curl related ones).
Then, an user can optionally set its own configuration options in another file. And by following XDG's recommendation, this file should be at ~/.config/sdkman/config/~/.config/sdkman/rc. Or ~/.sdkmanconfig/~/.sdkmanrc.
The sdkman-main should read the configuration this way:
# load default settingssource$SDKMAN_DIR/etc/config
# load user settingssource$XDG_CONFIG_HOME/sdkman/config
The latter instruction will override any variables set with the default settings.
The text was updated successfully, but these errors were encountered:
Feature request
All started with #928, which happened after I decided to include sdkman's config in my dotfiles repository: https://github.com/felipecrs/dotfiles/blob/c83fc79656129c35aa39501bab1c58f4a5bd683a/dot_sdkman/etc/config
So it turns out that sdkman expects some user configuration variables to be set, and treat them as the default settings. But it may not be a good idea to change the user's config file unattendedly during a self-update or on installation.
More insights comes from #927 (comment):
So my proposal is:
Have the
~/.sdkman/etc/config
as the default configuration source. This file can be included in this repository, and it does not need to be primed during an installation or dynamically updated during a self-update. An update of SDKMAN will contain the file, just like the other files.Inside of this file, all the possible configuration variables will be set with their default values (some of them can be removed from
sdkman-init.sh
thus, such as thecurl
related ones).Then, an user can optionally set its own configuration options in another file. And by following XDG's recommendation, this file should be at
~/.config/sdkman/config
/~/.config/sdkman/rc
. Or~/.sdkmanconfig
/~/.sdkmanrc
.The sdkman-main should read the configuration this way:
The latter instruction will override any variables set with the default settings.
The text was updated successfully, but these errors were encountered: