INNER CODE UNIT · TypeScript
getConfig
exoframejs/exoframe · packages/exoframe-cli/src/config/index.ts:39
export async function getConfig() {
// copy default config
let userConfig: CliUserConfig = structuredClone(defaultConfig);
// create config folder if doesn't exist
try {
await stat(baseFolder);
} catch {
await mkdir(baseFolder, { recursive: true });
}
// create default user config if doesn't exist
try {
await stat(configPath);
} catch {
// write default config to file
await writeFile(configPath, jsyaml.dump(userConfig), 'utf8');
// return it