diff options
| author | Dax Raad <[email protected]> | 2026-03-05 21:59:20 -0500 |
|---|---|---|
| committer | Dax Raad <[email protected]> | 2026-03-05 21:59:20 -0500 |
| commit | dad248832d31521d978a4ed24d9ade5e19abc160 (patch) | |
| tree | 4d5e6ac42cf7c578b788b3c91a759fe57f601f35 | |
| parent | 6e89d3e597c31fc160306763a37ab368ca2232d1 (diff) | |
| download | opencode-dad248832d31521d978a4ed24d9ade5e19abc160.tar.gz opencode-dad248832d31521d978a4ed24d9ade5e19abc160.zip | |
refactor: replace Bun.write with Filesystem.write in config files
| -rw-r--r-- | packages/opencode/src/config/config.ts | 4 | ||||
| -rw-r--r-- | packages/opencode/src/config/migrate-tui-config.ts | 6 |
2 files changed, 6 insertions, 4 deletions
diff --git a/packages/opencode/src/config/config.ts b/packages/opencode/src/config/config.ts index 28c5b239a..6b4242a22 100644 --- a/packages/opencode/src/config/config.ts +++ b/packages/opencode/src/config/config.ts @@ -1240,7 +1240,7 @@ export namespace Config { if (!parsed.data.$schema && isFile) { parsed.data.$schema = "https://opencode.ai/config.json" const updated = original.replace(/^\s*\{/, '{\n "$schema": "https://opencode.ai/config.json",') - await Bun.write(options.path, updated).catch(() => {}) + await Filesystem.write(options.path, updated).catch(() => {}) } const data = parsed.data if (data.plugin && isFile) { @@ -1401,3 +1401,5 @@ export namespace Config { return state().then((x) => x.directories) } } +Filesystem.write +Filesystem.write diff --git a/packages/opencode/src/config/migrate-tui-config.ts b/packages/opencode/src/config/migrate-tui-config.ts index b426e4fbd..dbe33ffb4 100644 --- a/packages/opencode/src/config/migrate-tui-config.ts +++ b/packages/opencode/src/config/migrate-tui-config.ts @@ -70,7 +70,7 @@ export async function migrateTuiConfig(input: MigrateInput) { if (extracted.keybinds !== undefined) payload.keybinds = extracted.keybinds if (tui) Object.assign(payload, tui) - const wrote = await Bun.write(target, JSON.stringify(payload, null, 2)) + const wrote = await Filesystem.write(target, JSON.stringify(payload, null, 2)) .then(() => true) .catch((error) => { log.warn("failed to write tui migration target", { from: file, to: target, error }) @@ -104,7 +104,7 @@ async function backupAndStripLegacy(file: string, source: string) { const hasBackup = await Filesystem.exists(backup) const backed = hasBackup ? true - : await Bun.write(backup, source) + : await Filesystem.write(backup, source) .then(() => true) .catch((error) => { log.warn("failed to backup source config during tui migration", { path: file, backup, error }) @@ -123,7 +123,7 @@ async function backupAndStripLegacy(file: string, source: string) { return applyEdits(acc, edits) }, source) - return Bun.write(file, text) + return Filesystem.write(file, text) .then(() => { log.info("stripped tui keys from server config", { path: file, backup }) return true |
