mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-08-03 05:02:54 +00:00
cloudRequire renamed to require and moved to module srvfunc.js
This commit is contained in:
parent
a4f71aca2b
commit
d0ce7b27f5
7 changed files with 136 additions and 186 deletions
|
|
@ -1,9 +1,14 @@
|
|||
/* module make possible connectoin thrue socket.io on a server */
|
||||
|
||||
var LIBDIRSERVER = './lib/server/',
|
||||
io = require('socket.io'),
|
||||
var DIR = process.cwd(),
|
||||
SRVDIR = DIR + '/lib/server/',
|
||||
|
||||
srvfunc = require(SRVDIR + '/srvfunc'),
|
||||
|
||||
io = srvfunc.require('socket.io'),
|
||||
exec = require('child_process').exec,
|
||||
update = cloudRequire(LIBDIRSERVER + 'update'),
|
||||
update = srvfunc.require(SRVDIR + 'update'),
|
||||
|
||||
ClientFuncs = [],
|
||||
OnMessageFuncs = [],
|
||||
Win32_b = process.platform === 'win32';
|
||||
|
|
@ -129,17 +134,4 @@ var Win32Commands = ['ASSOC', 'AT', 'ATTRIB', 'BREAK', 'CACLS', 'CALL',
|
|||
'PUSHD', 'RD', 'RECOVER', 'REM', 'REN', 'RENAME',
|
||||
'REPLACE', 'RMDIR', 'SET', 'SETLOCAL', 'SHIFT', 'SORT',
|
||||
'START', 'SUBST', 'TIME', 'TITLE', 'TREE', 'TYPE',
|
||||
'VER', 'VERIFY', 'VOL', 'XCOPY'];
|
||||
|
||||
/**
|
||||
* function do safe require of needed module
|
||||
* @param pModule
|
||||
*/
|
||||
function cloudRequire(pModule){
|
||||
try{
|
||||
return require(pModule);
|
||||
}
|
||||
catch(pError){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
'VER', 'VERIFY', 'VOL', 'XCOPY'];
|
||||
Loading…
Add table
Add a link
Reference in a new issue