Closed erhhung closed 9 months ago
I see two places where the $XDG_DATA_HOME
environment variable is used differently:
func xdgShareHome() (string, error)
func (c *SrvRunCmd) dataParentDir() (string, error)
with the latter function adding the superfluous path components.
Observed behavior
When running
nats server run --jetstream
, the Store Directory shown in the JetStream banner output repeats the ".local/share/
" path components:Apparently, if the
XDG_DATA_HOME
environment variable isn't set, the default store directory is correct:Expected behavior
Per the XDG Base Directory Specification, the
XDG_DATA_HOME
environment variable is optional: _if$XDG_DATA_HOME
is either not set or empty, a default equal to$HOME/.local/share
should be used_.That implies that if the variable is defined in the shell, apps that use it should treat it as if it were the default value—in this case, it was explicitly set by in my "
~/.bash_profile
" byexport XDG_DATA_HOME="$HOME/.local/share"
—and not repeat the ".local/share/
" path components.Server and client version
Host environment
macOS Sonoma 14.2.1
Steps to reproduce
No response