mirror of
https://github.com/bmadcode/BMAD-METHOD.git
synced 2025-12-29 16:14:59 +00:00
custom modules install after any non custom modules selected and after the core, manifest tracks custom modules separately to ensure always installed from the custom cache
This commit is contained in:
@@ -29,6 +29,7 @@ class ModuleManager {
|
||||
this.xmlHandler = new XmlHandler();
|
||||
this.bmadFolderName = 'bmad'; // Default, can be overridden
|
||||
this.scanProjectForModules = options.scanProjectForModules !== false; // Default to true for backward compatibility
|
||||
this.customModulePaths = new Map(); // Initialize custom module paths
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -47,6 +48,14 @@ class ModuleManager {
|
||||
this.coreConfig = coreConfig;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set custom module paths for priority lookup
|
||||
* @param {Map<string, string>} customModulePaths - Map of module ID to source path
|
||||
*/
|
||||
setCustomModulePaths(customModulePaths) {
|
||||
this.customModulePaths = customModulePaths;
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy a file and replace _bmad placeholder with actual folder name
|
||||
* @param {string} sourcePath - Source file path
|
||||
@@ -340,6 +349,11 @@ class ModuleManager {
|
||||
async findModuleSource(moduleName) {
|
||||
const projectRoot = getProjectRoot();
|
||||
|
||||
// First check custom module paths if they exist
|
||||
if (this.customModulePaths && this.customModulePaths.has(moduleName)) {
|
||||
return this.customModulePaths.get(moduleName);
|
||||
}
|
||||
|
||||
// First, check src/modules
|
||||
const srcModulePath = path.join(this.modulesSourcePath, moduleName);
|
||||
if (await fs.pathExists(srcModulePath)) {
|
||||
|
||||
Reference in New Issue
Block a user