test(teams): run cmd mcp preflight through shell on Windows

This commit is contained in:
777genius 2026-04-21 18:42:26 +03:00
parent 1c5fce5f0a
commit e20d74d95e

View file

@ -224,7 +224,12 @@ function spawnRealCli(
args: readonly string[],
options?: Parameters<typeof spawn>[2]
) {
return options ? spawn(command, [...args], options) : spawn(command, [...args]);
const spawnOptions = options ?? {};
const needsWindowsCommandShell = process.platform === 'win32' && /\.(bat|cmd)$/i.test(command);
return spawn(command, [...args], {
...spawnOptions,
...(needsWindowsCommandShell ? { shell: true } : {}),
});
}
async function removeTempRoot(dirPath: string): Promise<void> {