Skip to content

Use XDG_CONFIG_HOME for global config path - #2

Merged
martintrojer merged 1 commit into
martintrojer:mainfrom
krisajenkins:fix/xdg-config-path
Mar 15, 2026
Merged

Use XDG_CONFIG_HOME for global config path#2
martintrojer merged 1 commit into
martintrojer:mainfrom
krisajenkins:fix/xdg-config-path

Conversation

@krisajenkins

Copy link
Copy Markdown
Contributor

Summary

  • On macOS, dirs::config_dir() returns ~/Library/Application Support/, but the README documents ~/.config/vecgrep/config.toml and CLI users expect XDG-style paths
  • This caused the global config file to be silently ignored on macOS when placed at the documented path
  • Now respects $XDG_CONFIG_HOME if set, falling back to ~/.config/

Test plan

  • cargo test config::tests — all 8 tests pass
  • cargo clippy -- -D warnings — clean
  • Verified quiet = true in ~/.config/vecgrep/config.toml is picked up at runtime

On macOS, dirs::config_dir() returns ~/Library/Application Support/,
but the README documents ~/.config/vecgrep/config.toml and CLI users
expect XDG-style paths. This caused the global config file to be
silently ignored on macOS.

Now respects $XDG_CONFIG_HOME if set, falling back to ~/.config/.
@martintrojer
martintrojer merged commit 6b6d26f into martintrojer:main Mar 15, 2026
3 checks passed
martintrojer added a commit that referenced this pull request Mar 15, 2026
Use XDG_CONFIG_HOME for global config path
@krisajenkins
krisajenkins deleted the fix/xdg-config-path branch March 15, 2026 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants