Summary
Adopt the XDG Base Directory Specification for config file locations in the native CLI.
Motivation
Currently SDKMAN! stores its config at ~/.sdkman/etc/config. The XDG standard defines $XDG_CONFIG_HOME (defaulting to ~/.config) as the canonical location for user config files. Several community members have requested support for this — see sdkman-cli#1069 for prior art.
As part of the bash CLI rewrite, we plan to adopt XDG standards holistically. The native CLI should follow suit.
Requirements
- Read user config from
$XDG_CONFIG_HOME/sdkman/config (defaulting to ~/.config/sdkman/config)
- Respect
$XDG_DATA_HOME for data files (defaulting to ~/.local/share)
- Maintain backwards compatibility with existing
~/.sdkman layout during a transition period
- Follow precedence rules: XDG config overrides legacy config if both exist
References
Summary
Adopt the XDG Base Directory Specification for config file locations in the native CLI.
Motivation
Currently SDKMAN! stores its config at
~/.sdkman/etc/config. The XDG standard defines$XDG_CONFIG_HOME(defaulting to~/.config) as the canonical location for user config files. Several community members have requested support for this — see sdkman-cli#1069 for prior art.As part of the bash CLI rewrite, we plan to adopt XDG standards holistically. The native CLI should follow suit.
Requirements
$XDG_CONFIG_HOME/sdkman/config(defaulting to~/.config/sdkman/config)$XDG_DATA_HOMEfor data files (defaulting to~/.local/share)~/.sdkmanlayout during a transition periodReferences
~/.config/sdkman/configto override~/.sdkman/etc/configsdkman-cli#1069