set config_dir properly when XDG_CONFIG_HOME is set #8
+2
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
With current implementation, when
XDG_CONFIG_HOME
is defined (regardless its value)./zen-release generate-config
will generate config at$XDG_CONFIG_HOME/.config/zen-desktop/config.toml
.Actually,
$XDG_CONFIG_HOME
should contains.config
as part of it according to Freedesktop's document:Therefore, previous code generates config file at e.g.
~/.config/.config/zen-desktop/config.toml
when XDG_CONFIG_HOME is defined, which isn't expected.As Implementation of zen/config/config-parser.c of zwin-project/zen repository reads config file at
~/.config/zen-desktop/config.toml
, it couldn't read config file at all.Reproduce the problem
run
It'll generate
$HOME/.config/.config/zen-desktop/config.toml
Summary
Append
.config/
only if$XDG_CONFIG_HOME
isn't defined.How to check the behavior
run
Then now it should generate
$HOME/.config/zen-desktop/config.toml
as expected.