Commit 51ef0a6d authored by Leo Iannacone's avatar Leo Iannacone

call fs.statSync once

parent 735dfa92
...@@ -37,13 +37,14 @@ function __get_files_list(dir, onlyDirectories, callback) { ...@@ -37,13 +37,14 @@ function __get_files_list(dir, onlyDirectories, callback) {
files.forEach( function(f) { files.forEach( function(f) {
try { try {
complete_path = path.join(dir, f); complete_path = path.join(dir, f);
stat = fs.statSync(complete_path)
if (onlyDirectories) { if (onlyDirectories) {
if (fs.statSync(complete_path).isDirectory()) { if (stat.isDirectory()) {
result.push(f); result.push(f);
} }
} }
else { else {
if (fs.statSync(complete_path).isFile()) { if (stat.isFile()) {
result.push(f); result.push(f);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment