@nomadmystic/wordpress-scaffold-cli
Version:
This project is created to speed up WordPress development
11 lines (10 loc) • 399 B
JavaScript
import fs from 'fs';
import PathUtils from './path-utils.js';
export const getInternalConfig = async (configPath) => {
const configFilePath = `${await PathUtils.whereAmI()}/internal/${configPath}`;
let jsonFile = fs.readFileSync(configFilePath, 'utf-8');
if (!jsonFile || typeof jsonFile === 'undefined' || jsonFile === '') {
return {};
}
return JSON.parse(jsonFile);
};