Skip to content

Commit 898bcde

Browse files
authored
refactor: migrate src/cli/cmd/agent.ts from Bun.file()/Bun.write() to Filesystem module (#14142)
1 parent d5971e2 commit 898bcde

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

packages/opencode/src/cli/cmd/agent.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { Agent } from "../../agent/agent"
66
import { Provider } from "../../provider/provider"
77
import path from "path"
88
import fs from "fs/promises"
9+
import { Filesystem } from "../../util/filesystem"
910
import matter from "gray-matter"
1011
import { Instance } from "../../project/instance"
1112
import { EOL } from "os"
@@ -202,8 +203,7 @@ const AgentCreateCommand = cmd({
202203

203204
await fs.mkdir(targetPath, { recursive: true })
204205

205-
const file = Bun.file(filePath)
206-
if (await file.exists()) {
206+
if (await Filesystem.exists(filePath)) {
207207
if (isFullyNonInteractive) {
208208
console.error(`Error: Agent file already exists: ${filePath}`)
209209
process.exit(1)
@@ -212,7 +212,7 @@ const AgentCreateCommand = cmd({
212212
throw new UI.CancelledError()
213213
}
214214

215-
await Bun.write(filePath, content)
215+
await Filesystem.write(filePath, content)
216216

217217
if (isFullyNonInteractive) {
218218
console.log(filePath)

0 commit comments

Comments
 (0)