From a1a0587a2b1a2fbf95bd157aa37567f2e6eef2aa Mon Sep 17 00:00:00 2001 From: miloschwartz Date: Wed, 16 Jul 2025 16:41:59 -0700 Subject: [PATCH 1/2] add build file --- .gitignore | 1 - server/build.ts | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 server/build.ts diff --git a/.gitignore b/.gitignore index d284c93f..167b4a91 100644 --- a/.gitignore +++ b/.gitignore @@ -35,4 +35,3 @@ bin test_event.json .idea/ server/db/index.ts -build.ts \ No newline at end of file diff --git a/server/build.ts b/server/build.ts new file mode 100644 index 00000000..babe5e8b --- /dev/null +++ b/server/build.ts @@ -0,0 +1 @@ +export const build = "oss" as any; From 92c09b884395581f6f65b404b84bf14cdde7cc6e Mon Sep 17 00:00:00 2001 From: miloschwartz Date: Wed, 16 Jul 2025 17:26:15 -0700 Subject: [PATCH 2/2] fix sqlite crash on code 13 bug --- server/db/sqlite/driver.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server/db/sqlite/driver.ts b/server/db/sqlite/driver.ts index 9a12b43d..124bd885 100644 --- a/server/db/sqlite/driver.ts +++ b/server/db/sqlite/driver.ts @@ -2,12 +2,12 @@ import { drizzle as DrizzleSqlite } from "drizzle-orm/better-sqlite3"; import Database from "better-sqlite3"; import * as schema from "./schema"; import path from "path"; -import fs from "fs/promises"; +import fs from "fs"; import { APP_PATH } from "@server/lib/consts"; import { existsSync, mkdirSync } from "fs"; export const location = path.join(APP_PATH, "db", "db.sqlite"); -export const exists = await checkFileExists(location); +export const exists = checkFileExists(location); bootstrapVolume(); @@ -19,9 +19,9 @@ function createDb() { export const db = createDb(); export default db; -async function checkFileExists(filePath: string): Promise { +function checkFileExists(filePath: string): boolean { try { - await fs.access(filePath); + fs.accessSync(filePath); return true; } catch { return false;