diff options
| author | Dax <[email protected]> | 2026-02-18 16:07:32 -0500 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-02-18 21:07:32 +0000 |
| commit | d5971e2da55fe266da577387c79f9967a5b8c5c1 (patch) | |
| tree | 1aad214d795b1a2ec5306548a5b45487db1fc3b9 | |
| parent | c71f4d4847b1a9689955ee63f9a18fcd577794ee (diff) | |
| download | opencode-d5971e2da55fe266da577387c79f9967a5b8c5c1.tar.gz opencode-d5971e2da55fe266da577387c79f9967a5b8c5c1.zip | |
refactor: migrate src/cli/cmd/import.ts from Bun.file() to Filesystem module (#14143)
| -rw-r--r-- | packages/opencode/src/cli/cmd/import.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/packages/opencode/src/cli/cmd/import.ts b/packages/opencode/src/cli/cmd/import.ts index fd45a09b7..4d65060f1 100644 --- a/packages/opencode/src/cli/cmd/import.ts +++ b/packages/opencode/src/cli/cmd/import.ts @@ -8,6 +8,7 @@ import { SessionTable, MessageTable, PartTable } from "../../session/session.sql import { Instance } from "../../project/instance" import { ShareNext } from "../../share/share-next" import { EOL } from "os" +import { Filesystem } from "../../util/filesystem" /** Discriminated union returned by the ShareNext API (GET /api/share/:id/data) */ export type ShareData = @@ -116,8 +117,7 @@ export const ImportCommand = cmd({ exportData = transformed } else { - const file = Bun.file(args.file) - exportData = await file.json().catch(() => {}) + exportData = await Filesystem.readJson<NonNullable<typeof exportData>>(args.file).catch(() => undefined) if (!exportData) { process.stdout.write(`File not found: ${args.file}`) process.stdout.write(EOL) |
