fix: 修复构建脚本中的进程执行问题

- 移除平台特定的 pnpm 命令路径检测逻辑
- 统一使用 'pnpm' 命令执行
- 启用 shell 模式以正确处理命令执行
- 确保子进程继承正确的标准输入输出流
This commit is contained in:
Jin Mao
2026-03-16 20:30:27 +08:00
parent 32db4cbd11
commit 9fe875355a

View File

@@ -4,7 +4,7 @@ const pnpmCommand =
process.env.npm_execpath &&
process.env.npm_execpath.endsWith('.cjs')
? [process.execPath, process.env.npm_execpath]
: [process.platform === 'win32' ? 'pnpm.cmd' : 'pnpm'];
: ['pnpm'];
const steps = [
['exec', 'tsdown', '--no-dts'],
@@ -23,7 +23,7 @@ const steps = [
for (const args of steps) {
const [command, ...commandArgs] = pnpmCommand;
const result = spawnSync(command, [...commandArgs, ...args], {
shell: false,
shell: true,
stdio: 'inherit',
});