Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CHANGED: do not throw on error #90

Closed
wants to merge 1 commit into from

Conversation

warpdesign
Copy link

del makes use of the globby package which takes a list of globs as parameter and returns a promise with the list of valid patterns.

So, with this directory tree:

/foo
/foo/bar
/access_denied

The code globby(['/bar', '/foo']) would return ['/foo']`.

So calling del(['/bar', '/foo']) would simply delete /foo and return `['/foo'] without any error.

While calling del(['access_denied', '/foo']) would reject the promise with a permission error, but /foo would have been deleted and there's no way to know it.

This pull_request attempts to make error handling more consistent, so both previous calls would return ['/foo'] so the developer can find if there was an error by comparing the original array and the returned array's length.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant