mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-24 03:05:41 +00:00
fix(dir) getSize: if error - return error in callback
This commit is contained in:
parent
1452488945
commit
978cfb3c5f
1 changed files with 5 additions and 3 deletions
|
|
@ -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()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue