mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 10:45:47 +00:00
refactored
This commit is contained in:
parent
610967cc12
commit
c034e23807
1 changed files with 8 additions and 9 deletions
|
|
@ -10,6 +10,7 @@
|
|||
io = main.require('socket.io'),
|
||||
update = main.srvrequire('update'),
|
||||
exec = main.child_process.exec,
|
||||
Util = main.util,
|
||||
|
||||
ClientFuncs = [],
|
||||
OnMessageFuncs = [],
|
||||
|
|
@ -50,18 +51,16 @@
|
|||
return function(pCommand) {
|
||||
console.log(pCommand);
|
||||
|
||||
if( pCommand.indexOf('cloudcmd') === 0 ){
|
||||
pCommand = pCommand.replace('cloudcmd', '');
|
||||
if( Util.isContainStr(pCommand, 'cloudcmd') ){
|
||||
pCommand = Util.removeStr(pCommand, 'cloudcmd');
|
||||
|
||||
if(pCommand.indexOf(' ') === 0){
|
||||
pCommand = pCommand.replace(' ','');
|
||||
if( Util.isContainStr(pCommand, ' ') ){
|
||||
pCommand = Util.removeStr(pCommand, ' ');
|
||||
|
||||
if(pCommand.indexOf('update') === 0){
|
||||
if(update)
|
||||
update.get();
|
||||
}
|
||||
if( Util.isContainStr(pCommand, 'update') && update )
|
||||
update.get();
|
||||
|
||||
if(pCommand.indexOf('exit') === 0)
|
||||
if( Util.strCmp(pCommand, 'exit') )
|
||||
pCommand = 'kill -9 ' + process.pid;
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue