(workDir: string)
| 123 | } |
| 124 | |
| 125 | export function loadConfig(workDir: string): PackConfig { |
| 126 | const filePath = getPackPath(workDir); |
| 127 | if (!fs.existsSync(filePath)) { |
| 128 | throw new Error( |
| 129 | `Could not find ${PACK_FILE}. Run npx @cremini/skillpack create first or work in a directory that contains ${PACK_FILE}`, |
| 130 | ); |
| 131 | } |
| 132 | const raw = fs.readFileSync(filePath, "utf-8"); |
| 133 | const parsed = JSON.parse(raw) as unknown; |
| 134 | validateConfigShape(parsed, filePath); |
| 135 | return parsed; |
| 136 | } |
| 137 | |
| 138 | export function saveConfig(workDir: string, config: PackConfig): void { |
| 139 | const filePath = getPackPath(workDir); |
nothing calls this directly
no test coverage detected