From e8d425759345e006aba13ca7c9e48b10e120351c Mon Sep 17 00:00:00 2001 From: Scott Jennings Date: Sun, 7 Dec 2025 21:30:57 -0600 Subject: [PATCH] refactor: simplify core module path handling per PR review - Use getModulePath('core') instead of getSourcePath('core') for API consistency - Remove redundant core module special-case check in runModuleInstaller() since findModuleSource() now properly handles core modules --- tools/cli/installers/lib/modules/manager.js | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/tools/cli/installers/lib/modules/manager.js b/tools/cli/installers/lib/modules/manager.js index 31fc2fd2..925aac48 100644 --- a/tools/cli/installers/lib/modules/manager.js +++ b/tools/cli/installers/lib/modules/manager.js @@ -302,7 +302,7 @@ class ModuleManager { async findModuleSource(moduleName) { // Special handling for core module - it's in src/core not src/modules if (moduleName === 'core') { - const corePath = getSourcePath('core'); + const corePath = getModulePath('core'); if (await fs.pathExists(corePath)) { return corePath; } @@ -1080,16 +1080,10 @@ class ModuleManager { * @param {Object} options - Installation options */ async runModuleInstaller(moduleName, bmadDir, options = {}) { - // Special handling for core module - it's in src/core not src/modules - let sourcePath; - if (moduleName === 'core') { - sourcePath = getSourcePath('core'); - } else { - sourcePath = await this.findModuleSource(moduleName); - if (!sourcePath) { - // No source found, skip module installer - return; - } + const sourcePath = await this.findModuleSource(moduleName); + if (!sourcePath) { + // No source found, skip module installer + return; } const installerPath = path.join(sourcePath, '_module-installer', 'installer.js');