@@ -9,16 +9,22 @@ import { cloneRepo, getReposStatus, getNoirCommitFromAztec, getRepoPath, REPOS_D
99import { writeSyncMetadata , stampMetadataMcpVersion , readSyncMetadata , SyncMetadata } from "../utils/sync-metadata.js" ;
1010import { clearErrorCache } from "../utils/error-lookup.js" ;
1111
12+ export interface RepoSyncStatus {
13+ name : string ;
14+ status : string ;
15+ commit ?: string ;
16+ }
17+
18+ export function isRepoError ( repo : RepoSyncStatus ) : boolean {
19+ return repo . status . startsWith ( "Error:" ) ;
20+ }
21+
1222export interface SyncResult {
1323 success : boolean ;
1424 metadataSafe : boolean ;
1525 message : string ;
1626 version : string ;
17- repos : {
18- name : string ;
19- status : string ;
20- commit ?: string ;
21- } [ ] ;
27+ repos : RepoSyncStatus [ ] ;
2228}
2329
2430/**
@@ -105,7 +111,7 @@ export async function syncRepos(options: {
105111 // leaves the old checkout while other repos sync to the new tag, producing a
106112 // mixed-version workspace.
107113 const aztecFailed = results . some (
108- ( r ) => r . name === "aztec-packages" && r . status . toLowerCase ( ) . includes ( "error" ) ,
114+ ( r ) => r . name === "aztec-packages" && isRepoError ( r ) ,
109115 ) ;
110116 if ( aztecFailed && ( force || version ) ) {
111117 return {
@@ -160,7 +166,7 @@ export async function syncRepos(options: {
160166 let versionedDocsMissing = false ;
161167 for ( const repo of syntheticRepos ) {
162168 const result = results . find ( ( r ) => r . name === repo . name ) ;
163- if ( ! result || result . status . toLowerCase ( ) . includes ( "error" ) ) continue ;
169+ if ( ! result || isRepoError ( result ) ) continue ;
164170
165171 for ( const sparsePath of repo . sparse || [ ] ) {
166172 if ( ! sparsePath . includes ( effectiveVersion ) ) continue ;
@@ -174,7 +180,7 @@ export async function syncRepos(options: {
174180 }
175181
176182 const allSuccess = results . every (
177- ( r ) => ! r . status . toLowerCase ( ) . includes ( "error" )
183+ ( r ) => ! isRepoError ( r )
178184 ) ;
179185
180186 log ?.( `Sync complete: ${ results . length } repos, ${ allSuccess ? "all succeeded" : "some failed" } ` , "info" ) ;
0 commit comments