1
0
mirror of https://github.com/sharkdp/bat.git synced 2025-09-02 03:12:25 +01:00

Merge pull request #2513 from nickelc/deps/dirs

Replace `dirs-next` with the original `dirs` crate
This commit is contained in:
David Peter
2023-03-24 22:07:47 +01:00
committed by GitHub
4 changed files with 17 additions and 18 deletions

View File

@@ -404,7 +404,7 @@ fn macos_dark_mode_active() -> bool {
const PREFERENCES_FILE: &str = "Library/Preferences/.GlobalPreferences.plist";
const STYLE_KEY: &str = "AppleInterfaceStyle";
let preferences_file = dirs_next::home_dir()
let preferences_file = dirs::home_dir()
.map(|home| home.join(PREFERENCES_FILE))
.expect("Could not get home directory");

View File

@@ -26,10 +26,10 @@ impl BatProjectDirs {
let config_dir_op = env::var_os("XDG_CONFIG_HOME")
.map(PathBuf::from)
.filter(|p| p.is_absolute())
.or_else(|| dirs_next::home_dir().map(|d| d.join(".config")));
.or_else(|| dirs::home_dir().map(|d| d.join(".config")));
#[cfg(not(target_os = "macos"))]
let config_dir_op = dirs_next::config_dir();
let config_dir_op = dirs::config_dir();
config_dir_op.map(|d| d.join("bat"))?
};
@@ -51,10 +51,10 @@ impl BatProjectDirs {
let cache_dir_op = env::var_os("XDG_CACHE_HOME")
.map(PathBuf::from)
.filter(|p| p.is_absolute())
.or_else(|| dirs_next::home_dir().map(|d| d.join(".cache")));
.or_else(|| dirs::home_dir().map(|d| d.join(".cache")));
#[cfg(not(target_os = "macos"))]
let cache_dir_op = dirs_next::cache_dir();
let cache_dir_op = dirs::cache_dir();
cache_dir_op.map(|d| d.join("bat"))
}