sindresorhus/trash

Broken symlinks are silently ignored

jdanford opened this issue · 3 comments

As the title says, the trash function silently ignores broken symlinks (because fs.existsSync returns false), whereas https://github.com/sindresorhus/macos-trash handles them as expected, i.e. moving them to the Trash. Is the former behavior intentional?

I don't remember exactly why we're doing it in the first place, but I think it's so not to error on non-existing paths. Relevant commit: 34e4d71

I guess we could use fs.lstatSync() instead to support broken symlinks.

That's what I was thinking – should I go ahead and submit a PR?

Yes :)