summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDax <[email protected]>2026-02-18 13:25:18 -0500
committerGitHub <[email protected]>2026-02-18 13:25:18 -0500
commit8bf06cbcc159a3a3a0711cff67c2e5538793445d (patch)
treee54af81d8fb5f297cb7a9b4bbe7047499b571eda
parentbe2e6f1926176dadb5a5cf12d5790189a6a5bb50 (diff)
downloadopencode-8bf06cbcc159a3a3a0711cff67c2e5538793445d.tar.gz
opencode-8bf06cbcc159a3a3a0711cff67c2e5538793445d.zip
refactor: migrate src/global/index.ts from Bun.file() to Filesystem module (#14146)
-rw-r--r--packages/opencode/src/global/index.ts7
1 files changed, 3 insertions, 4 deletions
diff --git a/packages/opencode/src/global/index.ts b/packages/opencode/src/global/index.ts
index 10b6125a6..2913ac90f 100644
--- a/packages/opencode/src/global/index.ts
+++ b/packages/opencode/src/global/index.ts
@@ -2,6 +2,7 @@ import fs from "fs/promises"
import { xdgData, xdgCache, xdgConfig, xdgState } from "xdg-basedir"
import path from "path"
import os from "os"
+import { Filesystem } from "../util/filesystem"
const app = "opencode"
@@ -35,9 +36,7 @@ await Promise.all([
const CACHE_VERSION = "21"
-const version = await Bun.file(path.join(Global.Path.cache, "version"))
- .text()
- .catch(() => "0")
+const version = await Filesystem.readText(path.join(Global.Path.cache, "version")).catch(() => "0")
if (version !== CACHE_VERSION) {
try {
@@ -51,5 +50,5 @@ if (version !== CACHE_VERSION) {
),
)
} catch (e) {}
- await Bun.file(path.join(Global.Path.cache, "version")).write(CACHE_VERSION)
+ await Filesystem.write(path.join(Global.Path.cache, "version"), CACHE_VERSION)
}