1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Library: properly handle symlinked folders

This commit is contained in:
Nathanaël Lécaudé 2020-11-24 18:29:39 -05:00 committed by Nick O'Leary
parent 2f86bb1ca5
commit c5d38d8962
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9

View File

@ -102,7 +102,8 @@ function getLibraryEntry(type,path) {
var files = []; var files = [];
fns.sort().filter(function(fn) { fns.sort().filter(function(fn) {
var fullPath = fspath.join(path,fn); var fullPath = fspath.join(path,fn);
var absoluteFullPath = fspath.join(root,fullPath); // we use fs.realpathSync to also resolve Symbolic Link
var absoluteFullPath = fs.realpathSync(fspath.join(root,fullPath));
if (fn[0] != ".") { if (fn[0] != ".") {
var stats = fs.lstatSync(absoluteFullPath); var stats = fs.lstatSync(absoluteFullPath);
if (stats.isDirectory()) { if (stats.isDirectory()) {