Repository navigation
fix(settings): honor XDG_CONFIG_HOME for the global settings path - #1581
Closed
sanketpatel32 wants to merge 1 commit into
Closed
sanketpatel32 wants to merge 1 commit into
sanketpatel32 wants to merge 1 commit into
Conversation
The non-Windows settings path was hardcoded to ~/.config. Per the XDG Base Directory spec, $XDG_CONFIG_HOME (when set to an absolute path) now takes precedence; empty or relative values are ignored. Fixes TagStudioDev#1407
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.
Summary
Fixes #1407. The global settings path on non-Windows platforms was hardcoded to
~/.config/TagStudio/settings.toml, ignoring$XDG_CONFIG_HOME.DEFAULT_GLOBAL_SETTINGS_PATHnow resolves through a small helper: on non-Windows it uses$XDG_CONFIG_HOME/TagStudio/settings.tomlwhen the variable is set to an absolute path, and falls back to~/.config/...when unset, empty, or relative (per the XDG Base Directory spec, relative values must be ignored).XDG_CONFIG_HOME=/tmp/xdgtest→/tmp/xdgtest/TagStudio/settings.toml; unset and relative values fall back to~/.config.Tasks Completed
XDG_CONFIG_HOME; pre-commit hooks passing)