fix(ide): Added normalization for config.extension, added .yml to the extension array
This commit is contained in:
parent
39b9abe5aa
commit
2e6d44220f
|
|
@ -195,14 +195,16 @@ class ConfigDrivenIdeSetup extends BaseIdeSetup {
|
||||||
if (header_template || body_template) {
|
if (header_template || body_template) {
|
||||||
const content = await this.loadSplitTemplates(templateType, artifactType, header_template, body_template);
|
const content = await this.loadSplitTemplates(templateType, artifactType, header_template, body_template);
|
||||||
// Allow config to override extension, default to .md
|
// Allow config to override extension, default to .md
|
||||||
return { content, extension: config.extension || '.md' };
|
const ext = config.extension || '.md';
|
||||||
|
const normalizedExt = ext.startsWith('.') ? ext : `.${ext}`;
|
||||||
|
return { content, extension: normalizedExt };
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load combined template - try multiple extensions
|
// Load combined template - try multiple extensions
|
||||||
// If artifactType is empty, templateType already contains full name (e.g., 'gemini-workflow-yaml')
|
// If artifactType is empty, templateType already contains full name (e.g., 'gemini-workflow-yaml')
|
||||||
const templateBaseName = artifactType ? `${templateType}-${artifactType}` : templateType;
|
const templateBaseName = artifactType ? `${templateType}-${artifactType}` : templateType;
|
||||||
const templateDir = path.join(__dirname, 'templates', 'combined');
|
const templateDir = path.join(__dirname, 'templates', 'combined');
|
||||||
const extensions = ['.md', '.toml', '.yaml'];
|
const extensions = ['.md', '.toml', '.yaml', '.yml'];
|
||||||
|
|
||||||
for (const ext of extensions) {
|
for (const ext of extensions) {
|
||||||
const templatePath = path.join(templateDir, templateBaseName + ext);
|
const templatePath = path.join(templateDir, templateBaseName + ext);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue