(directory: string, cb: () => Promise<T>)
| 2 | import { context } from "../project/instance-context" |
| 3 | |
| 4 | export async function bootstrap<T>(directory: string, cb: () => Promise<T>) { |
| 5 | const ctx = await InstanceRuntime.load({ directory }) |
| 6 | try { |
| 7 | return await context.provide(ctx, cb) |
| 8 | } finally { |
| 9 | await InstanceRuntime.disposeInstance(ctx) |
| 10 | } |
| 11 | } |
no outgoing calls