From PR #1624: added empty module.yaml handling (skip + warn) and removed paths from the config to match promptCustomContentSource()

This commit is contained in:
Curtis Ide 2026-02-15 09:11:18 -07:00
parent 2ab713de36
commit 589f65a654
No known key found for this signature in database
1 changed files with 14 additions and 6 deletions

View File

@ -327,6 +327,11 @@ class UI {
continue; continue;
} }
if (!moduleMeta) {
await prompts.log.warn(`Skipping custom content path: ${customPath} - module.yaml is empty`);
continue;
}
if (!moduleMeta.code) { if (!moduleMeta.code) {
await prompts.log.warn(`Skipping custom content path: ${customPath} - module.yaml missing 'code' field`); await prompts.log.warn(`Skipping custom content path: ${customPath} - module.yaml missing 'code' field`);
continue; continue;
@ -346,11 +351,10 @@ class UI {
selectedCustomModules: selectedModuleIds, selectedCustomModules: selectedModuleIds,
customContentConfig: { customContentConfig: {
hasCustomContent: true, hasCustomContent: true,
paths: customPaths,
selectedModuleIds: selectedModuleIds,
sources,
selected: true, selected: true,
sources,
selectedFiles: customPaths.map((p) => path.join(p, 'module.yaml')), selectedFiles: customPaths.map((p) => path.join(p, 'module.yaml')),
selectedModuleIds: selectedModuleIds,
}, },
}; };
} }
@ -477,6 +481,11 @@ class UI {
continue; continue;
} }
if (!moduleMeta) {
await prompts.log.warn(`Skipping custom content path: ${customPath} - module.yaml is empty`);
continue;
}
if (!moduleMeta.code) { if (!moduleMeta.code) {
await prompts.log.warn(`Skipping custom content path: ${customPath} - module.yaml missing 'code' field`); await prompts.log.warn(`Skipping custom content path: ${customPath} - module.yaml missing 'code' field`);
continue; continue;
@ -494,11 +503,10 @@ class UI {
if (customPaths.length > 0) { if (customPaths.length > 0) {
customContentConfig = { customContentConfig = {
hasCustomContent: true, hasCustomContent: true,
paths: customPaths,
selectedModuleIds: selectedModuleIds,
sources,
selected: true, selected: true,
sources,
selectedFiles: customPaths.map((p) => path.join(p, 'module.yaml')), selectedFiles: customPaths.map((p) => path.join(p, 'module.yaml')),
selectedModuleIds: selectedModuleIds,
}; };
} }
} else if (!options.yes) { } else if (!options.yes) {