@playcraft/build 0.1.63 → 0.1.65
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -436,7 +436,10 @@ export class GenericAdapter {
|
|
|
436
436
|
});
|
|
437
437
|
let stdout = '';
|
|
438
438
|
let stderr = '';
|
|
439
|
+
let stdoutStart = '';
|
|
440
|
+
let stderrStart = '';
|
|
439
441
|
child.stdout?.on('data', (data) => {
|
|
442
|
+
stdoutStart = (stdoutStart + data.toString()).slice(0, 2000);
|
|
440
443
|
stdout += data.toString();
|
|
441
444
|
// 限制输出长度
|
|
442
445
|
if (stdout.length > 10000) {
|
|
@@ -444,6 +447,7 @@ export class GenericAdapter {
|
|
|
444
447
|
}
|
|
445
448
|
});
|
|
446
449
|
child.stderr?.on('data', (data) => {
|
|
450
|
+
stderrStart = (stderrStart + data.toString()).slice(0, 2000);
|
|
447
451
|
stderr += data.toString();
|
|
448
452
|
// 限制输出长度
|
|
449
453
|
if (stderr.length > 10000) {
|
|
@@ -469,8 +473,8 @@ export class GenericAdapter {
|
|
|
469
473
|
else {
|
|
470
474
|
reject(new Error(`[GenericAdapter] 命令退出码非零: ${code}\n` +
|
|
471
475
|
`命令: ${cmd} ${args.join(' ')}\n` +
|
|
472
|
-
`stdout: ${stdout.slice(-1000)}\n` +
|
|
473
|
-
`stderr: ${stderr.slice(-1000)}`));
|
|
476
|
+
`stdout: ${stdout.length <= 2000 ? stdout : `${stdoutStart}\n[…中间输出省略…]\n${stdout.slice(-1000)}`}\n` +
|
|
477
|
+
`stderr: ${stderr.length <= 2000 ? stderr : `${stderrStart}\n[…中间输出省略…]\n${stderr.slice(-1000)}`}`));
|
|
474
478
|
}
|
|
475
479
|
});
|
|
476
480
|
});
|