mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-08-02 04:33:09 +00:00
added ability to rename files
This commit is contained in:
parent
e8de73985e
commit
216b1d38ba
3 changed files with 16 additions and 12 deletions
|
|
@ -212,7 +212,7 @@
|
|||
if(lRet){
|
||||
var p = pParams,
|
||||
lCmd = p.command,
|
||||
lFiles = Util.stringifyJSON(p.body);
|
||||
lFiles = Util.parseJSON(p.body);
|
||||
console.log(p.body);
|
||||
switch(lCmd){
|
||||
case 'auth':
|
||||
|
|
@ -234,14 +234,15 @@
|
|||
});
|
||||
break;
|
||||
case 'mv':
|
||||
if(lFiles)
|
||||
Util.log(lFiles);
|
||||
if( Util.checkObjTrue(lFiles, ['from', 'to']) )
|
||||
fs.rename(lFiles.from, lFiles.to, function(pError){
|
||||
if(!pError)
|
||||
main.sendResponse(pParams);
|
||||
else
|
||||
main.sendError(pParams, pError);
|
||||
});
|
||||
else
|
||||
main.sendError(pParams, p.data);
|
||||
break;
|
||||
|
||||
case 'cp':
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue