diff options
| author | Dax <[email protected]> | 2026-02-18 16:08:01 -0500 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-02-18 21:08:01 +0000 |
| commit | 898bcdec870c1c9c1ea6f3bea9af5bc8616ac5cd (patch) | |
| tree | a05e2b5a0d477a87e32571935989bde542e255a4 | |
| parent | d5971e2da55fe266da577387c79f9967a5b8c5c1 (diff) | |
| download | opencode-898bcdec870c1c9c1ea6f3bea9af5bc8616ac5cd.tar.gz opencode-898bcdec870c1c9c1ea6f3bea9af5bc8616ac5cd.zip | |
refactor: migrate src/cli/cmd/agent.ts from Bun.file()/Bun.write() to Filesystem module (#14142)
| -rw-r--r-- | packages/opencode/src/cli/cmd/agent.ts | 6 |
1 files 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) |
