mirror of
https://github.com/thedotmack/claude-mem.git
synced 2026-09-20 04:23:02 +08:00
fix(windows): hide console when npm install helper spawns npm
Marketplace dependency install used spawn('npm') with a Windows shell but
without windowsHide, which flashes a console during npx claude-mem install.
This commit is contained in:
@@ -56,6 +56,7 @@ export function runNpmStrict(cwd: string, flags: string[]): Promise<NpmResult> {
|
||||
const child = spawn('npm', flags, {
|
||||
cwd,
|
||||
stdio: ['ignore', 'pipe', 'pipe'],
|
||||
windowsHide: true,
|
||||
...(IS_WINDOWS ? { shell: process.env.ComSpec ?? 'cmd.exe' } : {}),
|
||||
});
|
||||
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
import { describe, it, expect } from 'bun:test';
|
||||
import { readFileSync } from 'fs';
|
||||
import { join } from 'path';
|
||||
|
||||
const SOURCE = readFileSync(
|
||||
join(import.meta.dir, '../src/npx-cli/install/npm-install-helper.ts'),
|
||||
'utf8',
|
||||
);
|
||||
|
||||
describe('npm-install-helper Windows spawn', () => {
|
||||
it('hides the console window when spawning npm (incl. Windows shell)', () => {
|
||||
expect(SOURCE).toContain('windowsHide: true');
|
||||
expect(SOURCE).toMatch(
|
||||
/spawn\(\s*'npm',\s*flags,\s*\{[\s\S]*?windowsHide:\s*true[\s\S]*?\}\)/,
|
||||
);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user