mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 13:11:22 +00:00
feat: bundle provider auth plugins
Co-authored-by: ItzR3NO <ItzR3NO@users.noreply.github.com>
This commit is contained in:
@@ -15,7 +15,9 @@ function makeTempDir() {
|
||||
|
||||
async function withStateDir<T>(stateDir: string, fn: () => Promise<T>) {
|
||||
const prev = process.env.CLAWDBOT_STATE_DIR;
|
||||
const prevBundled = process.env.CLAWDBOT_BUNDLED_PLUGINS_DIR;
|
||||
process.env.CLAWDBOT_STATE_DIR = stateDir;
|
||||
process.env.CLAWDBOT_BUNDLED_PLUGINS_DIR = "/nonexistent/bundled/plugins";
|
||||
vi.resetModules();
|
||||
try {
|
||||
return await fn();
|
||||
@@ -25,6 +27,11 @@ async function withStateDir<T>(stateDir: string, fn: () => Promise<T>) {
|
||||
} else {
|
||||
process.env.CLAWDBOT_STATE_DIR = prev;
|
||||
}
|
||||
if (prevBundled === undefined) {
|
||||
delete process.env.CLAWDBOT_BUNDLED_PLUGINS_DIR;
|
||||
} else {
|
||||
process.env.CLAWDBOT_BUNDLED_PLUGINS_DIR = prevBundled;
|
||||
}
|
||||
vi.resetModules();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user