Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions packages/opencode/src/cli/cmd/uninstall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}
Expand All @@ -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[] = []
Expand Down Expand Up @@ -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> {
Expand Down
3 changes: 2 additions & 1 deletion packages/opencode/src/config/markdown.ts
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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)
Expand Down
Loading