fix(auto-update): stop after signaled subprocesses

This commit is contained in:
Afloat committed 2026-11-11 21:05:30 +08:00
1 parent d2ef268059
commit ca422f3c19
2 files changed
+136 -2

No files matched your search

+3 -2
View File
@@ -174,9 +174,10 @@ function runExternalCommand(command, args, options = {}) {
throw result.error;
}
if (typeof result.status === 'number' && result.status !== 0) {
if (result.status !== 0) {
const errorOutput = (result.stderr || result.stdout || '').trim();
throw new Error(`${command} ${args.join(' ')} failed${errorOutput ? `: ${errorOutput}` : ''}`);
const failure = result.signal ? `was terminated by ${result.signal}` : 'failed';
throw new Error(`${command} ${args.join(' ')} ${failure}${errorOutput ? `: ${errorOutput}` : ''}`);
}
return result;