summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDax <[email protected]>2026-02-18 12:35:32 -0500
committerGitHub <[email protected]>2026-02-18 12:35:32 -0500
commit8f4a72c57a28009a576f65ee713c1241fc3df35f (patch)
tree825ebd996d681c3a129d9a93c29ac2e4ac41662e
parentef155f3766868d3148efa8925e432b974edf0353 (diff)
downloadopencode-8f4a72c57a28009a576f65ee713c1241fc3df35f.tar.gz
opencode-8f4a72c57a28009a576f65ee713c1241fc3df35f.zip
refactor: migrate config/markdown.ts from Bun.file() to Filesystem module (#14151)
-rw-r--r--packages/opencode/src/cli/cmd/uninstall.ts9
-rw-r--r--packages/opencode/src/config/markdown.ts3
2 files changed, 6 insertions, 6 deletions
diff --git a/packages/opencode/src/cli/cmd/uninstall.ts b/packages/opencode/src/cli/cmd/uninstall.ts
index 704d3572b..3d8e7e3f7 100644
--- a/packages/opencode/src/cli/cmd/uninstall.ts
+++ b/packages/opencode/src/cli/cmd/uninstall.ts
@@ -7,6 +7,7 @@ import { $ } from "bun"
import fs from "fs/promises"
import path from "path"
import os from "os"
+import { Filesystem } from "../../util/filesystem"
interface UninstallArgs {
keepConfig: boolean
@@ -267,9 +268,7 @@ async function getShellConfigFile(): Promise<string | null> {
.catch(() => false)
if (!exists) continue
- const content = await Bun.file(file)
- .text()
- .catch(() => "")
+ const content = await Filesystem.readText(file).catch(() => "")
if (content.includes("# opencode") || content.includes(".opencode/bin")) {
return file
}
@@ -279,7 +278,7 @@ async function getShellConfigFile(): Promise<string | null> {
}
async function cleanShellConfig(file: string) {
- const content = await Bun.file(file).text()
+ const content = await Filesystem.readText(file)
const lines = content.split("\n")
const filtered: string[] = []
@@ -315,7 +314,7 @@ async function cleanShellConfig(file: string) {
}
const output = filtered.join("\n") + "\n"
- await Bun.write(file, output)
+ await Filesystem.write(file, output)
}
async function getDirectorySize(dir: string): Promise<number> {
diff --git a/packages/opencode/src/config/markdown.ts b/packages/opencode/src/config/markdown.ts
index 4cd17746c..5b4ccf047 100644
--- a/packages/opencode/src/config/markdown.ts
+++ b/packages/opencode/src/config/markdown.ts
@@ -1,6 +1,7 @@
import { NamedError } from "@opencode-ai/util/error"
import matter from "gray-matter"
import { z } from "zod"
+import { Filesystem } from "../util/filesystem"
export namespace ConfigMarkdown {
export const FILE_REGEX = /(?<![\w`])@(\.?[^\s`,.]*(?:\.[^\s`,.]+)*)/g
@@ -68,7 +69,7 @@ export namespace ConfigMarkdown {
}
export async function parse(filePath: string) {
- const template = await Bun.file(filePath).text()
+ const template = await Filesystem.readText(filePath)
try {
const md = matter(template)