UNPKG

@lucidcms/core

Version:

The core of the Lucid CMS. It's responsible for spinning up the API and serving the CMS.

2 lines 558 B
import e from"../../constants/constants.mjs";import{translate as t}from"../i18n/translate.mjs";import n from"node:path";import r from"node:fs";const i=(i,a)=>{let o,s=n.parse(i).root,c=a??e.config.filename,l=e.config.extensions,u=e=>{let t=r.readdirSync(e).filter(e=>{let{name:t,ext:r}=n.parse(e);return t===c&&l.includes(r)});if(t.length>0&&t[0]){o=n.resolve(e,t[0]);return}let i=n.resolve(e,`..`);i===e||i===s||u(i)};if(u(i),!o)throw Error(t(`server:core.config.file.not.found`));return o};export{i as default}; //# sourceMappingURL=get-config-path.mjs.map