diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2024-07-01 18:17:17 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-01 18:17:17 -0400 |
commit | 6f30ef88a24e4c463d26c34f25b024fb48f3aea2 (patch) | |
tree | 357632b15f66281882f43a29647313e5ca33edc5 /cli/cache/deno_dir.rs | |
parent | b0cd43b5f3d4af8a6dca9d7a3fbeb281a9c39c19 (diff) |
fix(windows): check USERPROFILE env var for finding home directory (#24384)
Diffstat (limited to 'cli/cache/deno_dir.rs')
-rw-r--r-- | cli/cache/deno_dir.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/cli/cache/deno_dir.rs b/cli/cache/deno_dir.rs index 05de1cf7c..88d8a31c0 100644 --- a/cli/cache/deno_dir.rs +++ b/cli/cache/deno_dir.rs @@ -266,6 +266,12 @@ pub mod dirs { } pub fn home_dir() -> Option<PathBuf> { + if let Some(userprofile) = std::env::var_os("USERPROFILE") { + if !userprofile.is_empty() { + return Some(PathBuf::from(userprofile)); + } + } + known_folder(&knownfolders::FOLDERID_Profile) } } |