mirror of
https://github.com/Dictionarry-Hub/profilarr.git
synced 2026-02-01 07:10:47 +01:00
/**
* PCD README Handler
* Handles reading and writing README.md files for PCD repositories
*/
import { logger } from '$logger/logger.ts';
/**
* Read README from a PCD repository
*/
export async function readReadme(pcdPath: string): Promise<string | null> {
try {
return await Deno.readTextFile(`${pcdPath}/README.md`);
} catch {
return null;
}
}
/**
* Write README to a PCD repository
*/
export async function writeReadme(pcdPath: string, content: string): Promise<void> {
await Deno.writeTextFile(`${pcdPath}/README.md`, content);
await logger.info('Wrote README', {
source: 'PCDReadme',
meta: { path: pcdPath, content }
});
}