banzai-cli
banzai-cli copied to clipboard
Support XDG directory standard
Is your feature request related to a problem? Please describe. Cool kids keep their home directories clean.
Describe the solution you'd like to see
Support loading configuration from $XDG_CONFIG_HOME
.
Describe alternatives you've considered This is the way. No alternatives.
Additional context Should probably wait for spf13/viper#1048
- "If $XDG_CONFIG_HOME is either not set or empty, a default equal to $HOME/.config should be used."
- Load config from
$BANZAICONFIG
file, or from the first directory existing of- (maybe
$BANZAI_CONFIG_HOME
) -
$XDG_CONFIG_HOME/banzai
-
$HOME/.banzai
- (maybe
- Create new config dir in
$XDG_CONFIG_HOME
The correct (detailed) order is:
-
BANZAI_CONFIG_HOME
(if we want to support it) -
$XDG_CONFIG_HOME/banzai
-
$HOME/.config/banzai
(new default, fallback if$XDG_CONFIG_HOME
is not defined) -
$HOME/.banzai
(for backward compatibility)
I would stick to using $HOME/.config/banzai
only if XDG_CONFIG_HOME is not set.
That's exactly what the above means. (And that's why I emphasized the order)
That's exactly what the above means. (And that's why I emphasized the order)
Not really. We shouldn't check $HOME/.config/banzai if a different XDG_CONFIG_HOME is set, but there is no banzai config there.
Why not?
Why not?
Because the referenced xdg standard defines it this way.
No. It only says what should be the fallback if the relevant env var is not defined. Nothing says we can't use it otherwise.
But determining a location for writing a config for the first time is tricky (even without this search entry)
No. It only says what should be the fallback if the relevant env var is not defined. Nothing says we can't use it otherwise.
Yes, and that's the only difference between the two lists in the first two comments on this issue...