@digicms/cms
Version:
An open source headless CMS solution to create and manage your own API. It provides a powerful dashboard and features to make your life easier. Databases supported: MySQL, MariaDB, PostgreSQL, SQLite
23 lines (18 loc) • 579 B
JavaScript
;
const path = require('path');
const fs = require('fs-extra');
const requiredPaths = ['api', 'extensions', 'plugins', 'config', 'public'];
const checkFoldersExist = ({ appPath }) => {
const missingPaths = [];
for (const reqPath of requiredPaths) {
if (!fs.pathExistsSync(path.resolve(appPath, reqPath))) {
missingPaths.push(reqPath);
}
}
if (missingPaths.length > 0) {
throw new Error(`Missing required folders:\n${missingPaths.map((p) => `- ./${p}`).join('\n')}`);
}
};
module.exports = (config) => {
checkFoldersExist(config);
};