Skip to content

Commit 8d5e282

Browse files
authored
feat(deno_dir): check $XDG_CACHE_HOME before defaulting to system cache path (#73)
1 parent 36a7510 commit 8d5e282

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

rs_lib/src/deno_dir.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ pub fn resolve_deno_dir<
2929
maybe_custom_root.or_else(|| sys.env_var_path("DENO_DIR"));
3030
let root: PathBuf = if let Some(root) = maybe_custom_root {
3131
root
32+
} else if let Some(xdg_cache_dir) = sys.env_var_path("XDG_CACHE_HOME") {
33+
xdg_cache_dir.join("deno")
3234
} else if let Some(cache_dir) = sys.env_cache_dir() {
3335
// We use the OS cache dir because all files deno writes are cache files
3436
// Once that changes we need to start using different roots if DENO_DIR

0 commit comments

Comments
 (0)