Skip to content

Commit

Permalink
Tried advice from: #2
Browse files Browse the repository at this point in the history
  • Loading branch information
kmalakoff committed Jan 3, 2018
1 parent b871d7a commit 5be7015
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,25 @@ function processPath(fullPath, options, callback) {
if (err) return callback(err);

if (!keep) return callback(); // do not keep processing
processDirectory(fullPath, options, callback); // eslint-disable-line no-use-before-define
fs.lstat(fullPath, function(err2, stat2) {
if (err2) return callback(err2);

if (stat2.isSymbolicLink()) {
fs.stat(fullPath, function(err3, stat3) {
if (err3) return callback(err3);

if (stat3.isDirectory()) {
processDirectory(fullPath, options, callback); // eslint-disable-line no-use-before-define
} else {
callback();
}
});
} else if (stat2.isDirectory()) {
processDirectory(fullPath, options, callback); // eslint-disable-line no-use-before-define
} else {
callback();
}
});
});
} catch (err) {
callback(err);
Expand Down

0 comments on commit 5be7015

Please sign in to comment.