diff --git a/lib/server/socket.js b/lib/server/socket.js index 58c54603..b28aa874 100644 --- a/lib/server/socket.js +++ b/lib/server/socket.js @@ -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')