fix stdout pipe buffer blocking during package installation

This commit is contained in:
Tw93
2025-10-13 20:13:07 +08:00
parent ceec2e071f
commit 2fb47988fc
4 changed files with 14 additions and 8 deletions

3
bin/utils/shell.ts vendored
View File

@@ -5,11 +5,12 @@ export async function shellExec(
command: string,
timeout: number = 300000,
env?: Record<string, string>,
showOutput: boolean = false,
) {
try {
const { exitCode } = await execa(command, {
cwd: npmDirectory,
stdio: ['inherit', 'pipe', 'inherit'], // Hide stdout verbose, keep stderr
stdio: showOutput ? 'inherit' : ['inherit', 'pipe', 'inherit'],
shell: true,
timeout,
env: env ? { ...process.env, ...env } : process.env,