mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-18 00:47:01 +00:00
chore(cloudcmd) readConfig
This commit is contained in:
parent
9ad14967e7
commit
4180e160ba
1 changed files with 8 additions and 9 deletions
17
cloudcmd.js
17
cloudcmd.js
|
|
@ -176,20 +176,19 @@
|
|||
|
||||
function readConfig(callback) {
|
||||
fs.readFile(CONFIG_PATH, 'utf8', function(error, data) {
|
||||
var msg, status, readed;
|
||||
var status, json, msg;
|
||||
|
||||
if (error)
|
||||
status = 'error';
|
||||
status = 'error';
|
||||
else {
|
||||
status = 'ok';
|
||||
readed = Util.parseJSON(data);
|
||||
|
||||
main.config = Config = readed;
|
||||
status = 'ok';
|
||||
json = Util.parseJSON(data);
|
||||
main.config = Config = json;
|
||||
}
|
||||
|
||||
msg = CloudFunc.formatMsg('read', 'config', status);
|
||||
Util.log(msg);
|
||||
|
||||
msg = CloudFunc.formatMsg('read', 'config', status);
|
||||
|
||||
Util.log(msg);
|
||||
Util.exec(callback);
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue