Spaces:
Paused
Paused
File size: 480 Bytes
8523e75 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | import fs from "node:fs";
import { paperclipConfigSchema, type PaperclipConfig } from "@paperclipai/shared";
import { resolvePaperclipConfigPath } from "./paths.js";
export function readConfigFile(): PaperclipConfig | null {
const configPath = resolvePaperclipConfigPath();
if (!fs.existsSync(configPath)) return null;
try {
const raw = JSON.parse(fs.readFileSync(configPath, "utf-8"));
return paperclipConfigSchema.parse(raw);
} catch {
return null;
}
}
|