(openspecPath: string, extendMode: boolean)
| 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 |
no test coverage detected