mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 18:55:26 +00:00
27 lines
No EOL
658 B
JavaScript
27 lines
No EOL
658 B
JavaScript
(function(){
|
|
"strict mode";
|
|
|
|
var DIR = process.cwd() + '/',
|
|
LIBDIR = DIR + 'lib/',
|
|
SRVDIR = LIBDIR + 'server/',
|
|
Util = require(LIBDIR + 'util');
|
|
|
|
/**
|
|
* function do safe require of needed module
|
|
* @param pModule
|
|
*/
|
|
exports.require = function srvrequire(pSrc){
|
|
var lModule,
|
|
|
|
lError = Util.tryCatch(function(){
|
|
lModule = require(pSrc);
|
|
});
|
|
|
|
if(lError)
|
|
console.log(lError);
|
|
|
|
return lModule;
|
|
};
|
|
|
|
exports.isWin32 = process.platform === 'win32';
|
|
}()); |