mirror of
https://github.com/supabase/supabase.git
synced 2026-05-07 01:10:15 -04:00
3158807579
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.
21 lines
641 B
TypeScript
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()
|
|
}
|