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:
Peter Jaszkowiak
2020-10-01 21:02:44 -06:00
committed by GitHub
parent e60357d20d
commit 1aa336d837
20 changed files with 130 additions and 136 deletions

View File

@@ -4,13 +4,14 @@ const path = require('path');
const fs = require('fs');
const file = require('../../file');
const { paths } = require('../../constants');
const themesController = module.exports;
const defaultScreenshotPath = path.join(__dirname, '../../../public/images/themes/default.png');
themesController.get = async function (req, res, next) {
const themeDir = path.join(__dirname, '../../../node_modules', req.params.theme);
const themeDir = path.join(paths.nodeModules, req.params.theme);
const themeConfigPath = path.join(themeDir, 'theme.json');
let themeConfig;