- Operating System: MacOS, Linux
- Node.js version: 20.8.0, 18
fs-extra version: 11.1.1
Set up
touch testFile
ln -s testFile testLink1
ln -s testFile testLink2
Then, in node:
fs.copy('testLink1', 'testLink2');
Uncaught Error: Cannot copy 'testFile' to a subdirectory of itself, 'testFile'.
There are no directories involved here. The call to copyLink would succeed perfectly fine and do the correct thing in this case.