Conversation
| assert(fs.existsSync('testfile.txt')); | ||
| assert(fs.existsSync('dest/testfile.txt')); | ||
| assert(fs.existsSync('dir1/insideDir.txt')); | ||
| assert(!fs.existsSync('dest/insideDir.txt')); |
There was a problem hiding this comment.
This file should exist right? If it doesn't then the dest folder wasn't symlinked properly from the dir1 folder.
There was a problem hiding this comment.
I think it shouldn't. Symbolic relative links are relative to the destination, hard links are relative to the cwd.
insideDir.txt is inside dir1, not its parent directory, and dest points at dir1's parent
Try out this behavior with UNIX Ln and I think it should behave the same
There was a problem hiding this comment.
Ah, you're right. Not what I would have expected. Thanks for following up on this.
There was a problem hiding this comment.
For posterity, this is the test I ran manually:
➜ ~ docker run -it --rm ubuntu
root@784ff6f8e5e4:/# cd tmp
root@784ff6f8e5e4:/tmp# mkdir dir1
root@784ff6f8e5e4:/tmp# cd dir1/
root@784ff6f8e5e4:/tmp/dir1# ln -s ./ ../dest
root@784ff6f8e5e4:/tmp/dir1# touch insideDir.txt
root@784ff6f8e5e4:/tmp/dir1# cd ../
root@784ff6f8e5e4:/tmp# ls
dest dir1
root@784ff6f8e5e4:/tmp# ls dest
dest dir1
root@784ff6f8e5e4:/tmp# cd dest
root@784ff6f8e5e4:/tmp/dest# ls
dest dir1
root@784ff6f8e5e4:/tmp/dest# exit
exit
There was a problem hiding this comment.
It's a very confusing semantics. Hopefully the path.resolve() trick is good enough to fix things. I personally usually use full paths with GNU ln To get around the weirdness
327a7e8 to
ed4c09f
Compare
|
@ariporad this is ready for review |
|
@nfischer: Umm... I don't think I really understand this well enough to properly review it. It seems very confusing. I'll do some more research, and get back to you. |
|
@nfischer: Ok. |
|
LGTM! |
test(ln): add tests for linking to cwd
Add tests for symlinking to
./(this closes #363 if the behavior here is correct). If this behavior is not posix behavior, we should fix this instead.