Closed jdalton closed 7 years ago
I just tested it on some symlinks and trash
works, and fs.existsSync()
returns true
.
Hmm interesting, thanks! Sorry about that. I've already changed to removing the parent directory. If I run into it again I'll re-ping.
Hey folks,
Just ran into this issue, but another case. Here is the testcase:
$ mkdir test
$ cd test
$ mkdir foo bar
$ touch bar/dev.tpl
$ cd foo
$ ln -s ../bar/dev.tpl
$ mv ../bar ../baz
$ ls -la
total 8
drwxr-xr-x 3 jeanbon wheel 102 Jul 25 11:43 .
drwxr-xr-x 4 jeanbon wheel 136 Jul 25 11:43 ..
lrwxr-xr-x 1 jeanbon wheel 14 Jul 25 11:43 dev.tpl -> ../bar/dev.tpl
$ rm dev.tpl
$ ls -la
total 8
drwxr-xr-x 3 jeanbon wheel 102 Jul 25 11:43 .
drwxr-xr-x 4 jeanbon wheel 136 Jul 25 11:43 ..
lrwxr-xr-x 1 jeanbon wheel 14 Jul 25 11:43 dev.tpl -> ../bar/dev.tpl
OS: macOs Sierra Native Terminal App + ZSH
Under the hood
trash
uses an approximation offs.exists(symlink)
which will returnfalse
and so skip trashing symlinks.