Browse Source

Use linkPath if file/dir obtained via symlink.

Herby Vojčík 5 years ago
parent
commit
80f190dfdd
1 changed files with 4 additions and 4 deletions
  1. 4 4
      lib/config-builder.js

+ 4 - 4
lib/config-builder.js

@@ -7,13 +7,13 @@ var path = require('path'),
 function eachConfigFile(root, callback) {
     var result = {files: [], dirs: []};
     var find = findit(root, {followSymlinks: true});
-    find.on('file', function (file, stat) {
+    find.on('file', function (file, stat, linkPath) {
         if (file.match(/\.amd\.json$/)) {
-            result.files[file] = stat;
+            result.files[linkPath || file] = stat;
         }
     });
-    find.on('directory', function (dir, stat, stop) {
-        result.dirs[dir] = stat;
+    find.on('directory', function (dir, stat, stop, linkPath) {
+        result.dirs[linkPath || dir] = stat;
     });
     find.on('end', function () {
         callback(null, result);