MCPcopy
hub / github.com/Fission-AI/OpenSpec / writeManagedCommand

Function writeManagedCommand

test/core/migration.test.ts:27–38  ·  view source on GitHub ↗
(projectPath: string, workflowId: string)

Source from the content-addressed store, hash-verified

25}
26
27async function writeManagedCommand(projectPath: string, workflowId: string): Promise<void> {
28 const adapter = CommandAdapterRegistry.get('claude');
29 if (!adapter) {
30 throw new Error('Claude adapter not found');
31 }
32 const commandPath = adapter.getFilePath(workflowId);
33 const fullPath = path.isAbsolute(commandPath)
34 ? commandPath
35 : path.join(projectPath, commandPath);
36 await fsp.mkdir(path.dirname(fullPath), { recursive: true });
37 await fsp.writeFile(fullPath, '# command\n', 'utf-8');
38}
39
40function readRawConfig(): Record<string, unknown> {
41 return JSON.parse(fs.readFileSync(getGlobalConfigPath(), 'utf-8')) as Record<string, unknown>;

Callers 1

migration.test.tsFile · 0.85

Calls 3

getMethod · 0.80
getFilePathMethod · 0.80
writeFileMethod · 0.80

Tested by

no test coverage detected