mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-24 03:05:41 +00:00
feature(main) readFiles: add formatMsg
This commit is contained in:
parent
2c8edb698c
commit
a57058dbda
1 changed files with 11 additions and 4 deletions
|
|
@ -11,7 +11,7 @@
|
|||
SLASH,
|
||||
ISWIN32,
|
||||
ext,
|
||||
path, fs, zlib, url, pipe,
|
||||
path, fs, zlib, url, pipe, CloudFunc,
|
||||
|
||||
OK, FILE_NOT_FOUND, MOVED_PERMANENTLY,
|
||||
REQUEST, RESPONSE,
|
||||
|
|
@ -105,7 +105,7 @@
|
|||
exports.socket = srvrequire('socket'),
|
||||
exports.auth = srvrequire('auth').auth,
|
||||
exports.appcache = srvrequire('appcache'),
|
||||
exports.cloudfunc = librequire('cloudfunc'),
|
||||
exports.cloudfunc = CloudFunc = librequire('cloudfunc'),
|
||||
exports.dir = srvrequire('dir'),
|
||||
exports.rest = srvrequire('rest').api,
|
||||
exports.update = srvrequire('update'),
|
||||
|
|
@ -370,7 +370,8 @@
|
|||
lErrors,
|
||||
lReadedFiles = {},
|
||||
lDoneFunc = function (pParams){
|
||||
var lRet = Util.checkObj(pParams, ['error', 'data', 'params']);
|
||||
var msg, status,
|
||||
lRet = Util.checkObj(pParams, ['error', 'data', 'params']);
|
||||
|
||||
if(lRet){
|
||||
lDone.pop();
|
||||
|
|
@ -378,15 +379,21 @@
|
|||
lName = p.params;
|
||||
|
||||
if(p.error){
|
||||
status = 'error';
|
||||
if(!lErrors) lErrors = {};
|
||||
|
||||
lErrors[lName] = p.error;
|
||||
}
|
||||
else{
|
||||
Util.log(lName + ' readed');
|
||||
status = 'ok';
|
||||
lReadedFiles[lName] = p.data;
|
||||
}
|
||||
|
||||
lName = path.basename(lName);
|
||||
msg = CloudFunc.formatMsg('read', lName, status);
|
||||
|
||||
Util.log(msg);
|
||||
|
||||
if( !lDone.length )
|
||||
Util.exec(pCallBack, lErrors, lReadedFiles);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue