set config_dir properly when XDG_CONFIG_HOME is set#8
Open
Cj-bc wants to merge 1 commit intozwin-project:mainfrom
Open
set config_dir properly when XDG_CONFIG_HOME is set#8Cj-bc wants to merge 1 commit intozwin-project:mainfrom
Cj-bc wants to merge 1 commit intozwin-project:mainfrom
Conversation
XDG_CONFIG_HOME by default contains '.config' part: > $XDG_CONFIG_HOME defines the base directory relative to which user-specific > configuration files should be stored. > If $XDG_CONFIG_HOME is either not set or empty, a default equal to > $HOME/.config should be used. > > from: <https://specifications.freedesktop.org/basedir-spec/latest/ar01s03.html> Therefore, previous code generates config file at `~/.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. <https://github.com/zwin-project/zen/blob/736f1423db869cc7f86dfdbb16dc809c30264be4/zen/config/config-parser.c#L29-L31>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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_HOMEis defined (regardless its value)./zen-release generate-configwill generate config at$XDG_CONFIG_HOME/.config/zen-desktop/config.toml.Actually,
$XDG_CONFIG_HOMEshould contains.configas part of it according to Freedesktop's document:Therefore, previous code generates config file at e.g.
~/.config/.config/zen-desktop/config.tomlwhen 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.tomlSummary
Append
.config/only if$XDG_CONFIG_HOMEisn't defined.How to check the behavior
run
Then now it should generate
$HOME/.config/zen-desktop/config.tomlas expected.