2019-04-15 11:42:44 +02:00
|
|
|
const debug = require('ghost-ignition').debug('services:apps');
|
|
|
|
const Promise = require('bluebird');
|
|
|
|
const common = require('../../lib/common');
|
|
|
|
const config = require('../../config');
|
|
|
|
const loader = require('./loader');
|
2017-10-30 12:31:04 +00:00
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
init: function () {
|
|
|
|
debug('init begin');
|
2019-04-15 12:58:42 +02:00
|
|
|
const appsToLoad = config.get('apps:internal');
|
2017-10-30 12:31:04 +00:00
|
|
|
|
2019-04-15 11:42:44 +02:00
|
|
|
return Promise.map(appsToLoad, appName => loader.activateAppByName(appName))
|
2017-10-30 12:31:04 +00:00
|
|
|
.catch(function (err) {
|
2017-12-11 22:47:46 +01:00
|
|
|
common.logging.error(new common.errors.GhostError({
|
2017-10-30 12:31:04 +00:00
|
|
|
err: err,
|
2017-12-11 22:47:46 +01:00
|
|
|
context: common.i18n.t('errors.apps.appWillNotBeLoaded.error'),
|
|
|
|
help: common.i18n.t('errors.apps.appWillNotBeLoaded.help')
|
2017-10-30 12:31:04 +00:00
|
|
|
}));
|
|
|
|
});
|
2019-04-15 11:42:44 +02:00
|
|
|
}
|
2017-10-30 12:31:04 +00:00
|
|
|
};
|