fix: add missing sources/selectedFiles to CLI --custom-content config

The non-interactive --custom-content CLI flag builds a customContentConfig
object missing the `sources`, `selected`, and `selectedFiles` properties
that the installer expects. This causes findModuleSource() to fail with
"Source for module X is not available" because customModulePaths is never
populated.

Align both CLI code paths (modify and fresh install flows) with the config
shape produced by the interactive promptCustomContentSource() method.

Fixes #1623
This commit is contained in:
Jonah Schulte 2026-02-10 22:03:36 -05:00
parent 3e35057b89
commit eeeea6f204
1 changed files with 8 additions and 0 deletions

View File

@ -336,11 +336,15 @@ class UI {
}
if (customPaths.length > 0) {
const sources = customPaths.map((p, i) => ({ path: p, id: selectedModuleIds[i], name: selectedModuleIds[i] }));
customModuleResult = {
selectedCustomModules: selectedModuleIds,
customContentConfig: {
hasCustomContent: true,
selected: true,
paths: customPaths,
sources: sources,
selectedFiles: customPaths.map((p) => path.join(p, 'module.yaml')),
selectedModuleIds: selectedModuleIds,
},
};
@ -477,9 +481,13 @@ class UI {
}
if (customPaths.length > 0) {
const sources = customPaths.map((p, i) => ({ path: p, id: selectedModuleIds[i], name: selectedModuleIds[i] }));
customContentConfig = {
hasCustomContent: true,
selected: true,
paths: customPaths,
sources: sources,
selectedFiles: customPaths.map((p) => path.join(p, 'module.yaml')),
selectedModuleIds: selectedModuleIds,
};
}