- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 637
          Allow ~/.config/sdkman/config to override ~/.sdkman/etc/config
          #1069
        
          New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
| I may need to add tests and fix the CI. I would just like to receive a greenlight from the maintainers before I spend time on it. | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd really prefer to keep the base SDKMAN directory free from configuration. That is explicitly what the etc directory is for. Also, you will see no other files, just directories, in the base dir.
However, I would consider an override if you wanted an .sdkmanrc file in your home directory. That makes more sense and is more in line with what you would expect on a Unix system.
Another thing also not considered is the sdk config command for editing the configuration. Which of these files should it be responsible for editing?
| 
 That's what I'm proposing,  
 Actually, I considered and changed  | 
~/.sdkmanrc to overwrite ~/.sdkman/etc/config~/.sdkmanrc to override ~/.sdkman/etc/config
      | In any case please don't name it  An  A lot of popular tools use that convention, e.g. NPM and direnv https://docs.npmjs.com/cli/v8/configuring-npm/npmrc | 
| How about  | 
~/.sdkmanrc to override ~/.sdkman/etc/config~/.sdkmanconfig to override ~/.sdkman/etc/config
      | I would prefer not to have another file in my home directory. Use .config or something. (see #941) Just my 2 cents. | 
| Yeah, I also agree. 
 PS: sdkman won't create this file automatically. | 
~/.sdkmanconfig to override ~/.sdkman/etc/config~/.config/sdkman/config to override ~/.sdkman/etc/config
      | Changed. | 
| I'll be very honest, but I'm leaning towards not having this capability at all. I honestly don't think that our users want this feature since it has never been asked for before. Another point is that modern Linux systems do not store configuration directly in the home directory. Instead, the  Besides that, I think that this has many undesired side effects and consequences that simply haven't been thought through. | 
| @marc0der I changed already to ~/.config. | 
| Are there any updates on this issue? It is quite annoying that  | 
| I will wait for maintainers to comment before I rebase this PR. | 
| fi | ||
|  | ||
| # Load the sdkman user config if it exists. | ||
| if [ -f "${HOME}/.config/sdkman/config" ]; then | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"${XDG_CONFIG_HOME}/sdkman/config"
if XDG_CONFIG_HOME is not set then "${HOME}/.config/sdkman/config"
https://wiki.archlinux.org/title/XDG_Base_Directory#User_directories
| fi | ||
|  | ||
| # Load the sdkman user config if it exists. | ||
| if [ -f "${HOME}/.config/sdkman/config" ]; then | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see above
| 
 $ export SDKMAN_DIR="${XDG_DATA_HOME}/sdkman" && \
  curl -s "https://get.sdkman.io/" | bash~/.zshrc ### sdkman - https://sdkman.io/
readonly sdkman_home="${XDG_DATA_HOME}/sdkman"
if [ -d "${sdkman_home}" ]; then
  export SDKMAN_DIR="${sdkman_home}"
  if [ -s "${sdkman_home}/bin/sdkman-init.sh" ]; then
    . "${sdkman_home}/bin/sdkman-init.sh"
  fi
fiIt would be nice if there were a  $ export SDKMAN_DIR="${XDG_DATA_HOME}/sdkman" && \
  export SDKMAN_CONFIG_DIR="${XDG_CONFIG_HOME}/sdkman" && \
  curl -s "https://get.sdkman.io/" | bash | 
| @sdavids thanks for your suggestions, but I'll wait to have a go ahead from some maintainer before spending more time in this PR. | 
| 
 | 
Because the current approach is very dotfiles unfriendly.
Fixes #941