From 898bcdec870c1c9c1ea6f3bea9af5bc8616ac5cd Mon Sep 17 00:00:00 2001 From: Dax Date: Wed, 18 Feb 2026 16:08:01 -0500 Subject: [PATCH] refactor: migrate src/cli/cmd/agent.ts from Bun.file()/Bun.write() to Filesystem module (#14142) --- packages/opencode/src/cli/cmd/agent.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/opencode/src/cli/cmd/agent.ts b/packages/opencode/src/cli/cmd/agent.ts index e5da9fdb3..22ea5d46a 100644 --- a/packages/opencode/src/cli/cmd/agent.ts +++ b/packages/opencode/src/cli/cmd/agent.ts @@ -6,6 +6,7 @@ import { Agent } from "../../agent/agent" import { Provider } from "../../provider/provider" import path from "path" import fs from "fs/promises" +import { Filesystem } from "../../util/filesystem" import matter from "gray-matter" import { Instance } from "../../project/instance" import { EOL } from "os" @@ -202,8 +203,7 @@ const AgentCreateCommand = cmd({ await fs.mkdir(targetPath, { recursive: true }) - const file = Bun.file(filePath) - if (await file.exists()) { + if (await Filesystem.exists(filePath)) { if (isFullyNonInteractive) { console.error(`Error: Agent file already exists: ${filePath}`) process.exit(1) @@ -212,7 +212,7 @@ const AgentCreateCommand = cmd({ throw new UI.CancelledError() } - await Bun.write(filePath, content) + await Filesystem.write(filePath, content) if (isFullyNonInteractive) { console.log(filePath)