refactor: migrate src/storage/db.ts from Bun.file() to statSync (#14124)

This commit is contained in:
Dax
2026-02-18 19:20:03 -05:00
committed by GitHub
parent 57b63ea83d
commit a8347c3762
2 changed files with 2 additions and 44 deletions

View File

@@ -10,7 +10,7 @@ import { Log } from "../util/log"
import { NamedError } from "@opencode-ai/util/error"
import z from "zod"
import path from "path"
import { readFileSync, readdirSync } from "fs"
import { readFileSync, readdirSync, existsSync } from "fs"
import * as schema from "./schema"
declare const OPENCODE_MIGRATIONS: { sql: string; timestamp: number }[] | undefined
@@ -54,7 +54,7 @@ export namespace Database {
const sql = dirs
.map((name) => {
const file = path.join(dir, name, "migration.sql")
if (!Bun.file(file).size) return
if (!existsSync(file)) return
return {
sql: readFileSync(file, "utf-8"),
timestamp: time(name),