Files
supabase/apps/docs/resources/rootSync.ts
Charis 3158807579 ci(docs): sync script (#36001)
Add a script for syncing error codes from the repo to the database. This
is part of the newly created rootSync script, where all sync scripts
should be moved eventually.
2025-06-05 12:28:45 -04:00

21 lines
641 B
TypeScript

import '../scripts/utils/dotenv'
import { fileURLToPath } from 'node:url'
import { styleText } from 'node:util'
import { syncErrorCodes } from './error/errorSync'
async function sync(): Promise<void> {
console.log(styleText('magenta', 'Starting sync to database...'))
const allSyncResults = await Promise.all([syncErrorCodes()])
if (allSyncResults.some((result) => !result.isOk)) {
console.error(styleText('bold', styleText('red', 'Sync failed')))
process.exit(1)
} else {
console.log(styleText('bold', styleText('green', 'Sync successful')))
}
}
if (process.argv[1] === fileURLToPath(import.meta.url)) {
sync()
}