Skip to content

Commit 5e1bc7e

Browse files
critesjoshclaude
andcommitted
fix: use startsWith for error status checks instead of case-insensitive includes
Error statuses are always formatted as "Error: ...", so startsWith is more precise and avoids false positives from status messages that happen to contain the word "error". Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 30839c5 commit 5e1bc7e

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/tools/sync.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ export async function syncRepos(options: {
105105
// leaves the old checkout while other repos sync to the new tag, producing a
106106
// mixed-version workspace.
107107
const aztecFailed = results.some(
108-
(r) => r.name === "aztec-packages" && r.status.toLowerCase().includes("error"),
108+
(r) => r.name === "aztec-packages" && r.status.startsWith("Error:"),
109109
);
110110
if (aztecFailed && (force || version)) {
111111
return {
@@ -160,7 +160,7 @@ export async function syncRepos(options: {
160160
let versionedDocsMissing = false;
161161
for (const repo of syntheticRepos) {
162162
const result = results.find((r) => r.name === repo.name);
163-
if (!result || result.status.toLowerCase().includes("error")) continue;
163+
if (!result || result.status.startsWith("Error:")) continue;
164164

165165
for (const sparsePath of repo.sparse || []) {
166166
if (!sparsePath.includes(effectiveVersion)) continue;
@@ -174,7 +174,7 @@ export async function syncRepos(options: {
174174
}
175175

176176
const allSuccess = results.every(
177-
(r) => !r.status.toLowerCase().includes("error")
177+
(r) => !r.status.startsWith("Error:")
178178
);
179179

180180
log?.(`Sync complete: ${results.length} repos, ${allSuccess ? "all succeeded" : "some failed"}`, "info");

src/utils/format.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export function formatSyncResult(result: SyncResult): string {
1818
];
1919

2020
for (const repo of result.repos) {
21-
const icon = repo.status.toLowerCase().includes("error") ? "✗" : "✓";
21+
const icon = repo.status.startsWith("Error:") ? "✗" : "✓";
2222
lines.push(` ${icon} ${repo.name}: ${repo.status}`);
2323
}
2424

0 commit comments

Comments
 (0)