refactor(update): simplify progress with proper exit codes

This commit is contained in:
Benjamin Jesuiter
2026-01-11 01:14:59 +01:00
committed by Peter Steinberger
parent 35d42be828
commit 4102e2f1b8
2 changed files with 16 additions and 47 deletions

View File

@@ -19,8 +19,8 @@ export type UpdateCommandOptions = {
};
const STEP_LABELS: Record<string, string> = {
"git status": "Checking for uncommitted changes",
"git upstream": "Checking upstream branch",
"clean check": "Working directory is clean",
"upstream check": "Upstream branch exists",
"git fetch": "Fetching latest changes",
"git rebase": "Rebasing onto upstream",
"deps install": "Installing dependencies",
@@ -60,13 +60,8 @@ function createUpdateProgress(enabled: boolean): ProgressController {
const label = getStepLabel(step);
const duration = theme.muted(`(${formatDuration(step.durationMs)})`);
const icon =
step.status === "success"
? theme.success("\u2713")
: step.status === "skipped"
? theme.warn("\u25CB")
: theme.error("\u2717");
step.exitCode === 0 ? theme.success("\u2713") : theme.error("\u2717");
currentSpinner.stop(`${icon} ${label} ${duration}`);
currentSpinner = null;