mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-20 01:47:35 +00:00
chore(socket) add 'cloudcmd' -> CLOUDCMD
This commit is contained in:
parent
ee9cfacad0
commit
79f03880e3
1 changed files with 8 additions and 4 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue