mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 18:55:26 +00:00
refactor(cloudcmd) getContent
This commit is contained in:
parent
ee38bdfe23
commit
ee91a98641
1 changed files with 6 additions and 7 deletions
13
cloudcmd.js
13
cloudcmd.js
|
|
@ -239,15 +239,14 @@
|
|||
name = Util.removeStrOneTime(name, CloudFunc.FS) || main.SLASH;
|
||||
|
||||
fs.stat(name, function(error, stat) {
|
||||
var func = Util.retExec(callback, name);
|
||||
var isFile,
|
||||
isDir = stat && stat.isDirectory(),
|
||||
func = Util.retExec(callback, name);
|
||||
|
||||
if (error)
|
||||
func(error);
|
||||
if (!error && isDir)
|
||||
processContent(name, query, callback);
|
||||
else
|
||||
if (!stat.isDirectory())
|
||||
func(null, null, true);
|
||||
else
|
||||
processContent(name, query, callback);
|
||||
func(error, null, !isDir);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue