2020-03-20 11:58:26 +03:00
|
|
|
const debug = require('ghost-ignition').debug('services:apps');
|
|
|
|
const Promise = require('bluebird');
|
2020-03-23 22:43:01 +03:00
|
|
|
const common = require('../../../server/lib/common');
|
|
|
|
const config = require('../../../server/config');
|
2020-03-20 11:58:26 +03:00
|
|
|
const loader = require('./loader');
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
init: function () {
|
|
|
|
debug('init begin');
|
|
|
|
const appsToLoad = config.get('apps:internal');
|
|
|
|
|
|
|
|
return Promise.map(appsToLoad, appName => loader.activateAppByName(appName))
|
|
|
|
.catch(function (err) {
|
|
|
|
common.logging.error(new common.errors.GhostError({
|
|
|
|
err: err,
|
|
|
|
context: common.i18n.t('errors.apps.appWillNotBeLoaded.error'),
|
|
|
|
help: common.i18n.t('errors.apps.appWillNotBeLoaded.help')
|
|
|
|
}));
|
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|