/** * load the environment configurations * @param {string} configPath the path * to the config directory * @param {string} env the environment * e.g development, staging...etc * @returns {object} object contains the config directory * content and the directory path */ async function loadEnvConfig (configPath, env, noWarn) { if (!env) { return null; } const dirPath = path.resolve(configPath, env); if (await fs.canRead(dirPath)) { const content = await fs.dirContent(dirPath); return { content: content.files, dirPath }; } else { if (!_noLog) log.warn(ERRORS.NO_ENV_CONFIG); return null; } }
let pluginsSpec = _.find(content.files, _.matches(paths.spec));