feat: pull articles when database initialization
This commit is contained in:
parent
bc0b59042e
commit
0da14f3ebf
|
@ -2,8 +2,15 @@
|
|||
import type { Postgres } from '$lib/server/database';
|
||||
import fs from 'fs';
|
||||
import { compile } from 'mdsvex';
|
||||
import { execSync } from 'child_process';
|
||||
|
||||
export default async function init(db: Postgres) {
|
||||
// Create tables(when not exists)
|
||||
if (fs.existsSync('./articles/')) {
|
||||
console.log('Pulling articles from git..');
|
||||
const stdout = execSync('git pull', { cwd: './articles/' });
|
||||
console.log(stdout.toString());
|
||||
}
|
||||
|
||||
const schemas = [
|
||||
{
|
||||
name: 'article',
|
||||
|
|
Loading…
Reference in New Issue
Block a user