Don't check api.json files into git (#3565)
These were needed when the docs lived in a different repo, but they don't any more so we can get rid of them. ### Change Type - [x] `internal` — Does not affect user-facing stuff - [x] `chore` — Updating dependencies, other boring stuff
This commit is contained in:
parent
59b7c25270
commit
c9b7d328fe
28 changed files with 687 additions and 210019 deletions
|
@ -2,10 +2,14 @@ import path from 'path'
|
|||
import { open } from 'sqlite'
|
||||
import sqlite3 from 'sqlite3'
|
||||
|
||||
export async function connect(opts = {} as { reset?: boolean }) {
|
||||
export async function connect(opts: { reset?: boolean; mode: 'readonly' | 'readwrite' }) {
|
||||
const db = await open({
|
||||
filename: path.join(process.cwd(), 'content.db'),
|
||||
driver: sqlite3.Database,
|
||||
mode:
|
||||
opts.mode === 'readonly'
|
||||
? sqlite3.OPEN_READONLY
|
||||
: sqlite3.OPEN_CREATE | sqlite3.OPEN_READWRITE,
|
||||
})
|
||||
|
||||
if (opts.reset) {
|
||||
|
|
|
@ -9,7 +9,7 @@ import { generateExamplesContent } from './generateExamplesContent'
|
|||
|
||||
export async function refreshContent(opts = {} as { silent: boolean }) {
|
||||
if (!opts.silent) nicelog('◦ Resetting database...')
|
||||
const db = await connect({ reset: true })
|
||||
const db = await connect({ reset: true, mode: 'readwrite' })
|
||||
|
||||
if (!opts.silent) nicelog('◦ Adding authors to db...')
|
||||
await addAuthors(db, await require('../../content/authors.json'))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue