From 938fe9b0766c56aa364608843b0e7aaa7e416807 Mon Sep 17 00:00:00 2001 From: ClementTsang <34804052+ClementTsang@users.noreply.github.com> Date: Wed, 21 Aug 2024 20:13:19 -0400 Subject: [PATCH] changelog --- CHANGELOG.md | 2 ++ src/options.rs | 10 ++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 320b46d13..2d47df8ca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,8 @@ That said, these are more guidelines rather than hardset rules, though the proje ### Changes - [#1559](https://github.com/ClementTsang/bottom/pull/1559): Rename `--enable_gpu` to `--disable_gpu`, and make GPU features enabled by default. +- [#1570](https://github.com/ClementTsang/bottom/pull/1570): Consider `$XDG_CONFIG_HOME` on macOS when looking for a default config path in a + backwards-compatible fashion. ## [0.10.2] - 2024-08-05 diff --git a/src/options.rs b/src/options.rs index a7a9a1c38..7f75f39f9 100644 --- a/src/options.rs +++ b/src/options.rs @@ -1219,7 +1219,10 @@ mod test { use std::path::PathBuf; // Case three: no previous config, no XDG var. - std::env::set_var("XDG_CONFIG_HOME", ""); + // SAFETY: this is the only test that does this + unsafe { + std::env::remove_var("XDG_CONFIG_HOME"); + } let case_1 = dirs::config_dir() .map(|mut path| { @@ -1239,7 +1242,10 @@ mod test { assert_eq!(get_config_path(None), Some(case_2.clone())); // Case one: old non-XDG exists already - std::env::set_var("XDG_CONFIG_HOME", ""); + // SAFETY: this is the only test that does this + unsafe { + std::env::remove_var("XDG_CONFIG_HOME"); + } let case_3 = case_2; assert_eq!(get_config_path(None), Some(case_3)); }