Skip to content

Commit a8347c3

Browse files
authored
refactor: migrate src/storage/db.ts from Bun.file() to statSync (anomalyco#14124)
1 parent 57b63ea commit a8347c3

2 files changed

Lines changed: 2 additions & 44 deletions

File tree

  • .opencode/skill/bun-file-io
  • packages/opencode/src/storage

.opencode/skill/bun-file-io/SKILL.md

Lines changed: 0 additions & 42 deletions
This file was deleted.

packages/opencode/src/storage/db.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { Log } from "../util/log"
1010
import { NamedError } from "@opencode-ai/util/error"
1111
import z from "zod"
1212
import path from "path"
13-
import { readFileSync, readdirSync } from "fs"
13+
import { readFileSync, readdirSync, existsSync } from "fs"
1414
import * as schema from "./schema"
1515

1616
declare const OPENCODE_MIGRATIONS: { sql: string; timestamp: number }[] | undefined
@@ -54,7 +54,7 @@ export namespace Database {
5454
const sql = dirs
5555
.map((name) => {
5656
const file = path.join(dir, name, "migration.sql")
57-
if (!Bun.file(file).size) return
57+
if (!existsSync(file)) return
5858
return {
5959
sql: readFileSync(file, "utf-8"),
6060
timestamp: time(name),

0 commit comments

Comments
 (0)