feat(driver): prefer npm-global remediation with installer fallback
This commit is contained in:
parent
4a98ab2976
commit
8df567c327
4 changed files with 33 additions and 6 deletions
|
|
@ -77,6 +77,13 @@ async function validateRepoPath(repoPath) {
|
|||
return { ok: true, bbPath };
|
||||
}
|
||||
|
||||
function installerRemediation() {
|
||||
if (process.platform === 'win32') {
|
||||
return 'Primary: npm i -g beadboard. Fallback: powershell -ExecutionPolicy Bypass -File .\\install\\install.ps1';
|
||||
}
|
||||
return 'Primary: npm i -g beadboard. Fallback: bash ./install/install.sh';
|
||||
}
|
||||
|
||||
async function discoverBbPath() {
|
||||
const configuredRoots = splitPathVariable(process.env.BB_SEARCH_ROOTS || '');
|
||||
const roots = configuredRoots.length > 0 ? configuredRoots : [process.cwd(), path.join(homeRoot(), 'codex'), homeRoot()];
|
||||
|
|
@ -126,7 +133,7 @@ async function resolveBbPath() {
|
|||
source: 'env',
|
||||
resolved_path: null,
|
||||
reason: validated.reason,
|
||||
remediation: 'Set BB_REPO to your BeadBoard repo root, e.g. `$env:BB_REPO="C:\\path\\to\\beadboard"`.',
|
||||
remediation: `Set BB_REPO to your BeadBoard repo root, e.g. \`$env:BB_REPO="C:\\path\\to\\beadboard"\`. ${installerRemediation()}`,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -177,8 +184,7 @@ async function resolveBbPath() {
|
|||
source: 'none',
|
||||
resolved_path: null,
|
||||
reason: 'Unable to find bb command or bb.ps1.',
|
||||
remediation:
|
||||
'Set BB_REPO to your BeadBoard repo root, or install a global bb command, then retry.',
|
||||
remediation: `Set BB_REPO to your BeadBoard repo root, or install a global bb command, then retry. ${installerRemediation()}`,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue