mirror of
https://github.com/sharkdp/bat
synced 2024-11-28 06:40:26 +00:00
remove absolute path restraint from BAT_CACHE_PATH
This commit is contained in:
parent
a9a31dca7f
commit
4be5adc6f5
1 changed files with 2 additions and 4 deletions
|
@ -33,10 +33,8 @@ impl BatProjectDirs {
|
||||||
|
|
||||||
pub fn get_cache_dir() -> Option<PathBuf> {
|
pub fn get_cache_dir() -> Option<PathBuf> {
|
||||||
// on all OS prefer BAT_CACHE_PATH if set
|
// on all OS prefer BAT_CACHE_PATH if set
|
||||||
let cache_dir_op = env::var_os("BAT_CACHE_PATH")
|
let cache_dir_op = env::var_os("BAT_CACHE_PATH").map(PathBuf::from);
|
||||||
.map(PathBuf::from)
|
if cache_dir_op.is_some() {
|
||||||
.filter(|p| p.is_absolute());
|
|
||||||
if !cache_dir_op.is_none() {
|
|
||||||
return cache_dir_op;
|
return cache_dir_op;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue