Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use XDG_CONFIG_HOME for config instead of ~/.jjconfig #84

Closed
colemickens opened this issue Feb 25, 2022 · 1 comment · Fixed by #85
Closed

Use XDG_CONFIG_HOME for config instead of ~/.jjconfig #84

colemickens opened this issue Feb 25, 2022 · 1 comment · Fixed by #85

Comments

@colemickens
Copy link
Contributor

Expected Behavior

I was writing a home-manager module for jj and noticed that, at least per the tutorial, it expects a config file dumped in $HOME instead of respecting XDG dirs.

Actual Behavior

It follows XDG specs to allow users to have config files isolated to, for example, $HOME/.config/.

@colemickens
Copy link
Contributor Author

ref:

jj/lib/src/settings.rs

Lines 32 to 44 in 76974a9

pub fn for_user() -> Result<Self, config::ConfigError> {
let mut config = config::Config::new();
if let Some(home_dir) = dirs::home_dir() {
config.merge(
config::File::from(home_dir.join(".jjconfig"))
.required(false)
.format(config::FileFormat::Toml),
)?;
}
Ok(UserSettings { config })
}

also, this looks like the most popular library: https://crates.io/crates/dirs

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 a pull request may close this issue.

1 participant