If del-cli
fails due to improper usage (e.g. deleting the cwd or a file outside the cwd), the error message is really noisy:
❯ del ~/some/dir
file:///.../del-cli/node_modules/del/index.js:37
throw new Error('Cannot delete files/directories outside the current working directory. Can be overridden with the `force` option.');
^
Error: Cannot delete files/directories outside the current working directory. Can be overridden with the `force` option.
at safeCheck (file:///.../del-cli/node_modules/del/index.js:37:9)
at mapper (file:///.../del-cli/node_modules/del/index.js:83:4)
at file:///.../del-cli/node_modules/p-map/index.js:141:26
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Node.js v18.17.1
These errors should be caught and console.error
ed instead:
❯ del ~/some/dir
Cannot delete files/directories outside the current working directory. Can be overridden with the `force` option.
Maybe del
could export a DelError
class, and del-cli
could catch only those errors.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too