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

Replace dirs-next with the original dirs crate

The `dirs` crate was forked as `dirs-next` after the original repos were archived.
The fork hasn't released a new version since October 2020, while the original
has been taken off the shelf and has seen updates since then.
This commit is contained in:
Constantin Nickel
2023-03-24 18:13:24 +01:00
parent d20405b975
commit 0e148e35dd
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"))
}