properly bootstraps
This commit is contained in:
parent
52966e5d95
commit
ec1b08dcdd
|
@ -16,7 +16,7 @@ module.exports.create = function (app, xconfx, models) {
|
|||
// TODO read from file only, not db
|
||||
return models.ComDaplieWalnutConfig.get('config').then(function (conf) {
|
||||
if (!conf || !conf.primaryDomain/* || !conf.primaryEmail*/) {
|
||||
console.log('DEBUG incomplete conf', conf);
|
||||
console.log('[DEBUG] uninitialized or incomplete config:', JSON.stringify(conf));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -155,6 +155,7 @@ module.exports.create = function (app, xconfx, models) {
|
|||
|
||||
var configpath = path.join(__dirname, '..', '..', 'config', config.domain + '.json');
|
||||
safeConfig = { primaryDomain: config.domain };
|
||||
xconfx.primaryDomain = safeConfig.primaryDomain;
|
||||
return fs.writeFileAsync(configpath, JSON.stringify(safeConfig, null, ' '), 'utf8').then(function () {
|
||||
// TODO nix SQL
|
||||
return models.ComDaplieWalnutConfig.upsert('config', safeConfig);
|
||||
|
|
Loading…
Reference in New Issue