mirror of
https://github.com/Jeuners/ECC.git
synced 2026-09-10 23:42:31 +02:00
fix: eliminate child process spawns during session startup (#162)
getAvailablePackageManagers() spawned where.exe/which for each package manager (npm, pnpm, yarn, bun). During SessionStart hooks, these 4+ child processes combined with Bun's own initialization exceeded the spawn limit on Windows, freezing the terminal. Fix: Remove process spawning from the hot path. Steps 1-5 of detection (env var, project config, package.json, lock file, global config) already cover all file-based detection. If none match, default to npm without spawning. Also fix getSelectionPrompt() to list supported PMs without checking availability.
This commit is contained in:
parent
0f1597dccf
commit
75ab8e6194
2 changed files with 21 additions and 26 deletions
|
|
@ -66,8 +66,8 @@ async function main() {
|
|||
const pm = getPackageManager();
|
||||
log(`[SessionStart] Package manager: ${pm.name} (${pm.source})`);
|
||||
|
||||
// If package manager was detected via fallback, show selection prompt
|
||||
if (pm.source === 'fallback' || pm.source === 'default') {
|
||||
// If no explicit package manager config was found, show selection prompt
|
||||
if (pm.source === 'default') {
|
||||
log('[SessionStart] No package manager preference found.');
|
||||
log(getSelectionPrompt());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue