diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2024-09-28 08:50:16 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-28 08:50:16 -0400 |
commit | 1bb47805d6331ad048bd5e7ea2581aa230e8fc93 (patch) | |
tree | 7f8707f40415e26530f6e6ccd5cde86b22903163 /ext/fs/std_fs.rs | |
parent | fc739dc5eb2769e4608ccf08d23ca8ff0fcc19c5 (diff) |
refactor: move NpmCacheDir to deno_cache_dir (#25916)
Part of the ongoing work to move more of Deno's resolution out of the
CLI crate (for use in Wasm and other things)
Includes:
* https://github.com/denoland/deno_cache_dir/pull/60
Diffstat (limited to 'ext/fs/std_fs.rs')
-rw-r--r-- | ext/fs/std_fs.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/fs/std_fs.rs b/ext/fs/std_fs.rs index 443c26819..41a8569ba 100644 --- a/ext/fs/std_fs.rs +++ b/ext/fs/std_fs.rs @@ -101,7 +101,7 @@ impl FileSystem for RealFs { &self, path: &Path, recursive: bool, - mode: u32, + mode: Option<u32>, ) -> FsResult<()> { mkdir(path, recursive, mode) } @@ -109,7 +109,7 @@ impl FileSystem for RealFs { &self, path: PathBuf, recursive: bool, - mode: u32, + mode: Option<u32>, ) -> FsResult<()> { spawn_blocking(move || mkdir(&path, recursive, mode)).await? } @@ -407,11 +407,11 @@ impl FileSystem for RealFs { } } -fn mkdir(path: &Path, recursive: bool, mode: u32) -> FsResult<()> { +fn mkdir(path: &Path, recursive: bool, mode: Option<u32>) -> FsResult<()> { let mut builder = fs::DirBuilder::new(); builder.recursive(recursive); #[cfg(unix)] - { + if let Some(mode) = mode { use std::os::unix::fs::DirBuilderExt; builder.mode(mode); } |