chore(socket) add 'cloudcmd' -> CLOUDCMD

This commit is contained in:
coderaiser 2013-07-11 07:16:58 +00:00
parent ee9cfacad0
commit 79f03880e3

View file

@ -10,6 +10,8 @@
update = main.srvrequire('update'),
exec = main.child_process.exec,
Util = main.util,
mainpackage = main.mainpackage,
CLOUDCMD = mainpackage.name,
ClientFuncs = [],
OnMessageFuncs = [],
@ -97,8 +99,8 @@
Util.log('#' + pConnNum + ': ' + pCommand);
if( Util.isContainStrAtBegin(pCommand, 'cloudcmd') ){
pCommand = Util.removeStr(pCommand, 'cloudcmd');
if( Util.isContainStrAtBegin(pCommand, CLOUDCMD) ) {
pCommand = Util.removeStr(pCommand, CLOUDCMD);
if( Util.isContainStrAtBegin(pCommand, ' ') ){
pCommand = Util.removeStr(pCommand, ' ');
@ -114,8 +116,8 @@
}
else {
lMsg = {
stdout : 'cloudcmd exit \n' +
'cloudcmd update \n',
stdout : CLOUDCMD + ' exit \n' +
CLOUDCMD + ' update \n',
stderr : null
};
@ -125,6 +127,8 @@
Util.log('received from client: ' + pCommand);
Util.log('sended to client: ' + lMsg);
}
} else if( Util.isContainStrAtBegin(pCommand, 'cd ') ) {
pCommand = Util.removeStr(pCommand, 'cd ');
}
/* if we on windows and command is build in