Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cms/scripts/sync-mdx/mdxTransformer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ async function updateUploadAltOnce(

if (dryRun) {
console.log(
` 🏷️ [DRY-RUN] Would update alt text for upload #${id} from "${pathSlug}".`
` 🏷️ [DRY-RUN] Would update alt text for upload #${id} to "${alt ?? 'null'}" (entry: "${pathSlug}").`
)
updatedAltIds.set(id, alt)
Comment on lines 309 to 313
return
Expand Down
38 changes: 20 additions & 18 deletions cms/scripts/sync-mdx/syncCoordinator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,24 +140,26 @@ export async function syncAll(
errors: 0
}

for (const contentType of Object.keys(ctx.contentTypes) as Array<
keyof ContentTypes
>) {
try {
const results = await syncContentType(contentType, ctx, dryRun)
allResults.created += results.created
allResults.updated += results.updated
allResults.deleted += results.deleted
allResults.errors += results.errors
} catch (error) {
// syncContentType doesn't return Error directly (it accumulates errors
// into the per-content-type SyncResults), but we keep this guard for
// truly unexpected exceptions (programmer bugs, OOM, etc).
console.error(
`\n❌ Error syncing ${contentType}: ${(error as Error).message}`
)
allResults.errors++
}
const perTypeResults = await Promise.all(
(Object.keys(ctx.contentTypes) as Array<keyof ContentTypes>).map(
(contentType) =>
syncContentType(contentType, ctx, dryRun).catch((error) => {
// syncContentType doesn't return Error directly (it accumulates errors
// into the per-content-type SyncResults), but we keep this guard for
// truly unexpected exceptions (programmer bugs, OOM, etc).
console.error(
`\n❌ Error syncing ${contentType}: ${(error as Error).message}`
)
Comment on lines +150 to +152
return { created: 0, updated: 0, deleted: 0, errors: 1 }
})
)
)

for (const results of perTypeResults) {
allResults.created += results.created
allResults.updated += results.updated
allResults.deleted += results.deleted
allResults.errors += results.errors
}

return allResults
Expand Down
Loading