dsherret / dax

Cross-platform shell tools for Deno and Node.js inspired by zx.
MIT License
997 stars 34 forks source link

fix(rm): ignore `NotFound` errors when `--force` flag is set #93

Closed pkedy closed 1 year ago

pkedy commented 1 year ago

This PR adds a try/catch inside executeRemove and ignores NotFound errors when force is set.

This is inline with the behavior of rm -Rf on Unix.

pkedy commented 1 year ago

@dsherret I added the test. Pls approve the workflow to run. I'm expecting the test to fail on Windows because I don't know how the OS error from Deno.remove will be formatted. If that is the case, feel free to edit my branch to move this along. It would be great to get this in a release.

dsherret commented 1 year ago

I have a Windows machine. I'll fix it locally on Windows then push to the PR.