MCPcopy Index your code
hub / github.com/Fission-AI/OpenSpec / createConfig

Method createConfig

src/core/init.ts:627–645  ·  view source on GitHub ↗
(openspecPath: string, extendMode: boolean)

Source from the content-addressed store, hash-verified

625 // ═══════════════════════════════════════════════════════════
626
627 private async createConfig(openspecPath: string, extendMode: boolean): Promise<'created' | 'exists' | 'skipped'> {
628 const configPath = path.join(openspecPath, 'config.yaml');
629 const configYmlPath = path.join(openspecPath, 'config.yml');
630 const configYamlExists = fs.existsSync(configPath);
631 const configYmlExists = fs.existsSync(configYmlPath);
632
633 if (configYamlExists || configYmlExists) {
634 return 'exists';
635 }
636
637
638 try {
639 const yamlContent = serializeConfig({ schema: DEFAULT_SCHEMA });
640 await FileSystemUtils.writeFile(configPath, yamlContent);
641 return 'created';
642 } catch {
643 return 'skipped';
644 }
645 }
646
647 // ═══════════════════════════════════════════════════════════
648 // UI & OUTPUT

Callers 1

executeMethod · 0.95

Calls 2

serializeConfigFunction · 0.85
writeFileMethod · 0.80

Tested by

no test coverage detected