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) {
files.forEach( function(f) {
try {
complete_path = path.join(dir, f);
stat = fs.statSync(complete_path)
if (onlyDirectories) {
if (fs.statSync(complete_path).isDirectory()) {
if (stat.isDirectory()) {
result.push(f);
}
}
else {
if (fs.statSync(complete_path).isFile()) {
if (stat.isFile()) {
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