fix(update): use git status --porcelain for dirty check cross-platform

This commit is contained in:
Benjamin Jesuiter
2026-01-11 02:02:39 +01:00
committed by Peter Steinberger
parent 6cb55eaaa7
commit f3bd6e4957

View File

@@ -305,15 +305,17 @@ export async function runGatewayUpdate(
const beforeSha = beforeShaResult.stdout.trim() || null; const beforeSha = beforeShaResult.stdout.trim() || null;
const beforeVersion = await readPackageVersion(gitRoot); const beforeVersion = await readPackageVersion(gitRoot);
const cleanCheck = await runStep( const statusCheck = await runStep(
step( step(
"clean check", "Running git status",
["sh", "-c", `test -z "$(git -C '${gitRoot}' status --porcelain)"`], ["git", "-C", gitRoot, "status", "--porcelain"],
gitRoot, gitRoot,
), ),
); );
steps.push(cleanCheck); steps.push(statusCheck);
if (cleanCheck.exitCode !== 0) { const hasUncommittedChanges =
statusCheck.stdoutTail && statusCheck.stdoutTail.trim().length > 0;
if (hasUncommittedChanges) {
return { return {
status: "skipped", status: "skipped",
mode: "git", mode: "git",