fix(dir) getSize: if error - return error in callback

This commit is contained in:
coderaiser 2014-06-20 06:42:16 -04:00
parent 1452488945
commit 978cfb3c5f

View file

@ -52,7 +52,7 @@
total += size;
}
processDir(dir, calcSize, function() {
processDir(dir, calcSize, function(error) {
var result;
if (type !== 'raw')
@ -60,7 +60,7 @@
else
result = total;
Util.exec(callback, null, result);
Util.exec(callback, error, result);
});
};
@ -75,7 +75,9 @@
function getStat(dir, error, stat) {
--fileCounter;
if (!error)
if (error)
callback(error);
else
if (stat.isFile())
Util.exec(func, stat);
else if (stat.isDirectory()) {