MCPcopy Create free account
hub / github.com/CreminiAI/skillpack / loadConfig

Function loadConfig

src/pack-config.ts:125–136  ·  view source on GitHub ↗
(workDir: string)

Source from the content-addressed store, hash-verified

123}
124
125export 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
138export function saveConfig(workDir: string, config: PackConfig): void {
139 const filePath = getPackPath(workDir);

Callers

nothing calls this directly

Calls 3

getPackPathFunction · 0.85
validateConfigShapeFunction · 0.85
parseMethod · 0.80

Tested by

no test coverage detected