mihneadb / node-directory-tree

Convert a directory tree to a JS object.
MIT License
523 stars 106 forks source link

Circular symlink casues infinite loop #89

Closed airarrazaval closed 3 years ago

airarrazaval commented 3 years ago

As the title says, circular symbolic links causes an infinite loop. To replicate this issue you can do the following:

mkdir test
cd test
ln -s . symlink

Then in your script if you run the following:

const directoryTree = require('directory-tree');

directoryTree('/path/to/test/folder');
mihneadb commented 3 years ago

Fixed in #90. Thanks!