INNER CODE UNIT · TypeScript
readPrevious
runvendo/vendo · packages/vendo/src/actions/sync/index.ts:52
async function readPrevious(file: string, warnings: string[]): Promise<ToolsFile | null> {
let raw: string;
try {
raw = await fs.readFile(file, "utf8");
} catch {
return null; // first sync — nothing to diff against
}
try {
return toolsFileSchema.parse(JSON.parse(raw));
} catch {
warnings.push(`no parseable previous tools file at ${file}; treating this as the first sync`);
return null;
}
}
async function readOverrides(file: string): Promise<OverridesFile | null> {
let raw: string;
try {