fix issue with provider cache
This commit is contained in:
parent
8f852b396f
commit
b8bbee4718
1 changed files with 2 additions and 2 deletions
|
|
@ -232,8 +232,8 @@ export namespace Provider {
|
||||||
const s = await state()
|
const s = await state()
|
||||||
const existing = s.sdk.get(provider.id)
|
const existing = s.sdk.get(provider.id)
|
||||||
if (existing) return existing
|
if (existing) return existing
|
||||||
const [pkg, version] = provider.npm ?? provider.id
|
const pkg = provider.npm ?? provider.id
|
||||||
const mod = await import(await BunProc.install(pkg, version))
|
const mod = await import(await BunProc.install(pkg, "latest"))
|
||||||
const fn = mod[Object.keys(mod).find((key) => key.startsWith("create"))!]
|
const fn = mod[Object.keys(mod).find((key) => key.startsWith("create"))!]
|
||||||
const loaded = fn(s.providers[provider.id]?.options)
|
const loaded = fn(s.providers[provider.id]?.options)
|
||||||
s.sdk.set(provider.id, loaded)
|
s.sdk.set(provider.id, loaded)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue