mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-20 01:47:35 +00:00
refactor(socket) Util.isContainStrAtBegin -> equalPart
This commit is contained in:
parent
3f4ed02f40
commit
fdac6fb121
1 changed files with 5 additions and 4 deletions
|
|
@ -11,6 +11,7 @@
|
|||
exec = main.child_process.exec,
|
||||
Util = main.util,
|
||||
mainpackage = main.mainpackage,
|
||||
equalPart = Util.isContainStrAtBegin,
|
||||
CLOUDCMD = mainpackage.name,
|
||||
ClientFuncs = [],
|
||||
OnMessageFuncs = [],
|
||||
|
|
@ -126,9 +127,9 @@
|
|||
connName = '#' + pConnNum + ': ';
|
||||
Util.log(connName + pCommand);
|
||||
|
||||
if (Util.isContainStrAtBegin(pCommand, CLOUDCMD))
|
||||
if (equalPart(pCommand, CLOUDCMD))
|
||||
lRet = onCloudCmd(pCommand);
|
||||
else if( Util.isContainStrAtBegin(pCommand, 'cd ') )
|
||||
else if (equalPart(pCommand, 'cd '))
|
||||
lRet = onCD(pCommand);
|
||||
|
||||
if (lRet)
|
||||
|
|
@ -236,10 +237,10 @@
|
|||
|
||||
pCommand = Util.removeStr(pCommand, CLOUDCMD);
|
||||
|
||||
if( Util.isContainStrAtBegin(pCommand, ' ') ) {
|
||||
if (equalPart(pCommand, ' ')) {
|
||||
pCommand = Util.removeStr(pCommand, ' ');
|
||||
|
||||
if( Util.isContainStrAtBegin(pCommand, 'update') && update ) {
|
||||
if (equalPart(pCommand, 'update') && update) {
|
||||
update.get();
|
||||
lRet = {
|
||||
stdout: Util.addNewLine('update: ok')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue