XDG User Config File Fixes #110
Merged
Conversation
It's a vector of paths to files, not a directory.
…lable While we correctly calculated the location of XDG_CONFIG_HOME (default $HOME/.config/), we then never used it, thus the linapple/linapple.conf underneath it would never be read. Worse yet, later code, if had found no writable user configuration file at all, would create ~/.config/linapple/linapple.conf, truncating it if it already exists, thus wiping out any configuration the user had put in there.
If no writable user configuration file is found, we create one. However, this was incorrectly hardcoded to create linapple/linapple.conf under $HOME/.config/; that directory is correct only if $XDG_CONFIG_HOME is not set or is set to that value. We have already calculated the correct location of the XDG user config dir, so we can just re-use that value to fix this. Also change the warning when we cannot find any of the environment variables we needed to locate/create a user config file to make it clear that we checked $XDG_CONFIG_HOME as well as $HOME.
Also add --conf and --help to the Readme.
5684528
to
7bafc34
|
Are there any issues with this that are delaying a merge to |
1a5a1bd
into
linappleii:master
1 check passed
1 check passed
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.
LoadAllConfigurations()was not loading the XDG user config file (default $HOME/.config/linapple/linapple.conf) and, worse yet, wiping out the contents of that default path (whether or not it was the actual XDG user path) if no other user config file was found. This fixes both of these problems.See the commit messages for full details. The diffs will also be much more clear if you read the diffs for each individual commit.