diff options
Diffstat (limited to 'ext/fs/ops.rs')
-rw-r--r-- | ext/fs/ops.rs | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/ext/fs/ops.rs b/ext/fs/ops.rs index 083d1b15f..da52318a4 100644 --- a/ext/fs/ops.rs +++ b/ext/fs/ops.rs @@ -294,9 +294,16 @@ where let fs = { let mut state = state.borrow_mut(); - state - .borrow_mut::<P>() - .check_write(&path, "Deno.remove()")?; + if recursive { + state + .borrow_mut::<P>() + .check_write(&path, "Deno.remove()")?; + } else { + state + .borrow_mut::<P>() + .check_write_partial(&path, "Deno.remove()")?; + } + state.borrow::<FileSystemRc>().clone() }; |