mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 10:45:47 +00:00
added ability to create directory
This commit is contained in:
parent
ad8345ff34
commit
d1ca2f0c1b
3 changed files with 16 additions and 4 deletions
|
|
@ -291,7 +291,7 @@
|
|||
|
||||
function sendError(pParams, pError){
|
||||
var lRet = Util.checkObjTrue(pParams,
|
||||
['name', 'data', 'request', 'response']);
|
||||
['name', 'request', 'response']);
|
||||
|
||||
if(lRet){
|
||||
var p = pParams;
|
||||
|
|
|
|||
|
|
@ -83,7 +83,8 @@
|
|||
request : pParams.request,
|
||||
response: pParams.response,
|
||||
method : lMethod,
|
||||
name : lCmd
|
||||
name : lCmd,
|
||||
body : pParams.body
|
||||
});
|
||||
|
||||
if(lCmd[0] === '/'){
|
||||
|
|
@ -126,7 +127,18 @@
|
|||
break;
|
||||
|
||||
case 'PUT':
|
||||
lResult = onPUT(pParams);
|
||||
var lCmd = 'mkdir ' + lName;
|
||||
main.child_process.exec(lCmd, function(pError, pStdout, pStderr){
|
||||
var lError = pError || pStderr;
|
||||
if(!lError){
|
||||
pParams.data = pStdout;
|
||||
main.sendResponse(pParams);
|
||||
}
|
||||
else
|
||||
main.sendError(pParams, lError.toString() );
|
||||
});
|
||||
|
||||
lResult = true;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/* module make possible connectoin thrue socket.io on a server */
|
||||
|
||||
(function(){
|
||||
"use strict";
|
||||
'use strict';
|
||||
|
||||
var main = global.cloudcmd.main,
|
||||
SRVDIR = main.SRVDIR,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue