mirror of
https://github.com/fosrl/pangolin.git
synced 2025-08-01 08:34:53 +02:00
Merge branch 'dev' of github.com:fosrl/pangolin into dev
This commit is contained in:
commit
b3e63a5f8a
3 changed files with 5 additions and 5 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -35,4 +35,3 @@ bin
|
||||||
test_event.json
|
test_event.json
|
||||||
.idea/
|
.idea/
|
||||||
server/db/index.ts
|
server/db/index.ts
|
||||||
build.ts
|
|
1
server/build.ts
Normal file
1
server/build.ts
Normal file
|
@ -0,0 +1 @@
|
||||||
|
export const build = "oss" as any;
|
|
@ -2,12 +2,12 @@ import { drizzle as DrizzleSqlite } from "drizzle-orm/better-sqlite3";
|
||||||
import Database from "better-sqlite3";
|
import Database from "better-sqlite3";
|
||||||
import * as schema from "./schema";
|
import * as schema from "./schema";
|
||||||
import path from "path";
|
import path from "path";
|
||||||
import fs from "fs/promises";
|
import fs from "fs";
|
||||||
import { APP_PATH } from "@server/lib/consts";
|
import { APP_PATH } from "@server/lib/consts";
|
||||||
import { existsSync, mkdirSync } from "fs";
|
import { existsSync, mkdirSync } from "fs";
|
||||||
|
|
||||||
export const location = path.join(APP_PATH, "db", "db.sqlite");
|
export const location = path.join(APP_PATH, "db", "db.sqlite");
|
||||||
export const exists = await checkFileExists(location);
|
export const exists = checkFileExists(location);
|
||||||
|
|
||||||
bootstrapVolume();
|
bootstrapVolume();
|
||||||
|
|
||||||
|
@ -19,9 +19,9 @@ function createDb() {
|
||||||
export const db = createDb();
|
export const db = createDb();
|
||||||
export default db;
|
export default db;
|
||||||
|
|
||||||
async function checkFileExists(filePath: string): Promise<boolean> {
|
function checkFileExists(filePath: string): boolean {
|
||||||
try {
|
try {
|
||||||
await fs.access(filePath);
|
fs.accessSync(filePath);
|
||||||
return true;
|
return true;
|
||||||
} catch {
|
} catch {
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue