mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
refactor(cloudcmd) rm IsTest
This commit is contained in:
parent
1202c8b68a
commit
2c40a543a6
2 changed files with 15 additions and 14 deletions
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
switch (argvLast) {
|
||||
default:
|
||||
start({});
|
||||
start();
|
||||
break;
|
||||
|
||||
case '--test':
|
||||
|
|
@ -21,7 +21,7 @@
|
|||
Util.log('argv: ', argv);
|
||||
|
||||
start({
|
||||
isTest: true
|
||||
test: true
|
||||
});
|
||||
break;
|
||||
|
||||
|
|
|
|||
25
cloudcmd.js
25
cloudcmd.js
|
|
@ -42,8 +42,6 @@
|
|||
'link',
|
||||
],
|
||||
|
||||
IsTest,
|
||||
|
||||
Template = {},
|
||||
|
||||
FS = CloudFunc.FS;
|
||||
|
|
@ -51,9 +49,10 @@
|
|||
DIR = main.DIR;
|
||||
|
||||
exports.start = function(params) {
|
||||
IsTest = params.isTest;
|
||||
readConfig(function() {
|
||||
init(params);
|
||||
});
|
||||
|
||||
readConfig(init);
|
||||
win.prepareCodePage();
|
||||
};
|
||||
|
||||
|
|
@ -118,15 +117,15 @@
|
|||
}
|
||||
|
||||
|
||||
function init() {
|
||||
var params;
|
||||
function init(params) {
|
||||
var paramsStart;
|
||||
|
||||
Util.log('server dir: ' + DIR);
|
||||
|
||||
if (update)
|
||||
update.get();
|
||||
|
||||
Util.log('server dir: ' + DIR);
|
||||
|
||||
if (IsTest)
|
||||
if (params && params.test)
|
||||
Config.server = false;
|
||||
|
||||
if (Config.logs) {
|
||||
|
|
@ -136,13 +135,13 @@
|
|||
writeLogsToFile();
|
||||
}
|
||||
|
||||
params = {
|
||||
paramsStart = {
|
||||
appcache : appCacheProcessing,
|
||||
rest : main.rest,
|
||||
route : route
|
||||
};
|
||||
|
||||
readFiles(params, function(params) {
|
||||
readFiles(paramsStart, function(params) {
|
||||
server.start(params);
|
||||
});
|
||||
}
|
||||
|
|
@ -194,6 +193,8 @@
|
|||
}
|
||||
|
||||
function readConfig(callback) {
|
||||
Util.checkArgs(arguments, ['callback']);
|
||||
|
||||
fs.readFile(CONFIG_PATH, 'utf8', function(error, data) {
|
||||
var status, json, msg;
|
||||
|
||||
|
|
@ -208,7 +209,7 @@
|
|||
msg = CloudFunc.formatMsg('read', 'config', status);
|
||||
|
||||
Util.log(msg);
|
||||
Util.exec(callback);
|
||||
callback();
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue