From 573f1e22a2358cecca24fc913dbb9ea08e238355 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Misty=20De=20M=C3=A9o?= Date: Wed, 28 Aug 2024 10:47:00 -0700 Subject: [PATCH] feat: support XDG_CONFIG_HOME for receipts refs https://github.com/axodotdev/cargo-dist/pull/1355. --- axoupdater/src/receipt.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/axoupdater/src/receipt.rs b/axoupdater/src/receipt.rs index 288ab01..9717f9c 100644 --- a/axoupdater/src/receipt.rs +++ b/axoupdater/src/receipt.rs @@ -107,6 +107,8 @@ pub(crate) fn get_config_path(app_name: &str) -> AxoupdateResult { } else { let home = if cfg!(windows) { env::var("LOCALAPPDATA").map(PathBuf::from).ok() + } else if let Ok(config_home) = std::env::var("XDG_CONFIG_HOME") { + Some(PathBuf::from(config_home)) } else { homedir::my_home()?.map(|path| path.join(".config")) };