feat(update): show stderr for failed steps

This commit is contained in:
Benjamin Jesuiter
2026-01-11 01:26:14 +01:00
committed by Peter Steinberger
parent 3f27b23d5a
commit 6cb55eaaa7
2 changed files with 13 additions and 0 deletions

View File

@@ -64,6 +64,15 @@ function createUpdateProgress(enabled: boolean): ProgressController {
currentSpinner.stop(`${icon} ${label} ${duration}`);
currentSpinner = null;
if (step.exitCode !== 0 && step.stderrTail) {
const lines = step.stderrTail.split("\n").slice(-10);
for (const line of lines) {
if (line.trim()) {
defaultRuntime.log(` ${theme.error(line)}`);
}
}
}
},
};

View File

@@ -40,6 +40,7 @@ export type UpdateStepInfo = {
export type UpdateStepCompletion = UpdateStepInfo & {
durationMs: number;
exitCode: number | null;
stderrTail?: string | null;
};
export type UpdateStepProgress = {
@@ -199,10 +200,13 @@ async function runStep(opts: RunStepOptions): Promise<UpdateStepResult> {
const result = await runCommand(argv, { cwd, timeoutMs, env });
const durationMs = Date.now() - started;
const stderrTail = trimLogTail(result.stderr, MAX_LOG_CHARS);
progress?.onStepComplete?.({
...stepInfo,
durationMs,
exitCode: result.code,
stderrTail,
});
return {