|
|
|
@ -9,6 +9,7 @@ const nconf = require('nconf');
|
|
|
|
|
const _ = require('lodash');
|
|
|
|
|
|
|
|
|
|
const utils = require('./utils');
|
|
|
|
|
const { paths } = require('./constants');
|
|
|
|
|
|
|
|
|
|
const install = module.exports;
|
|
|
|
|
const questions = {};
|
|
|
|
@ -563,6 +564,16 @@ async function checkUpgrade() {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function installPlugins() {
|
|
|
|
|
const pluginInstall = require('./plugins');
|
|
|
|
|
const nbbVersion = require(paths.currentPackage).version;
|
|
|
|
|
await Promise.all((await pluginInstall.getActive()).map(async (id) => {
|
|
|
|
|
if (await pluginInstall.isInstalled(id)) return;
|
|
|
|
|
const version = await pluginInstall.suggest(id, nbbVersion);
|
|
|
|
|
await pluginInstall.toggleInstall(id, version.version);
|
|
|
|
|
}));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
install.setup = async function () {
|
|
|
|
|
try {
|
|
|
|
|
checkSetupFlagEnv();
|
|
|
|
@ -580,6 +591,7 @@ install.setup = async function () {
|
|
|
|
|
await enableDefaultPlugins();
|
|
|
|
|
await setCopyrightWidget();
|
|
|
|
|
await copyFavicon();
|
|
|
|
|
if (nconf.get('plugins:autoinstall')) await installPlugins();
|
|
|
|
|
await checkUpgrade();
|
|
|
|
|
|
|
|
|
|
const data = {
|
|
|
|
|