mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-07 14:35:47 +01:00
refactor: shared constants (#8707)
define plugin name and theme name regexs in one location for consistency define various shared paths in one place for consistency
This commit is contained in:
@@ -9,6 +9,7 @@ const winston = require('winston');
|
||||
|
||||
const db = require('./database');
|
||||
const file = require('./file');
|
||||
const { paths } = require('./constants');
|
||||
|
||||
/*
|
||||
* Need to write an upgrade script for NodeBB? Cool.
|
||||
@@ -61,7 +62,7 @@ Upgrade.appendPluginScripts = async function (files) {
|
||||
// Find all active plugins
|
||||
const plugins = await db.getSortedSetRange('plugins:active', 0, -1);
|
||||
plugins.forEach((plugin) => {
|
||||
const configPath = path.join(__dirname, '../node_modules', plugin, 'plugin.json');
|
||||
const configPath = path.join(paths.nodeModules, plugin, 'plugin.json');
|
||||
try {
|
||||
const pluginConfig = require(configPath);
|
||||
if (pluginConfig.hasOwnProperty('upgrades') && Array.isArray(pluginConfig.upgrades)) {
|
||||
|
||||
Reference in New Issue
Block a user