mirror of
https://github.com/sst/opencode.git
synced 2025-12-23 10:11:41 +00:00
chore(cli): resolve merge conflict with dev in bootstrap; keep try/finally with explicit return
This commit is contained in:
parent
d554e7aaef
commit
7fd81dd93e
1 changed files with 3 additions and 3 deletions
|
|
@ -6,10 +6,10 @@ export async function bootstrap<T>(directory: string, cb: () => Promise<T>) {
|
|||
directory,
|
||||
init: InstanceBootstrap,
|
||||
fn: async () => {
|
||||
// Ensure we always dispose instance state, even on errors,
|
||||
// so the CLI does not hang due to lingering watchers/subscriptions.
|
||||
// Guarantee teardown of process-scoped state even on errors
|
||||
try {
|
||||
return await cb()
|
||||
const result = await cb()
|
||||
return result
|
||||
} finally {
|
||||
await Instance.dispose()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue