feat: bundle provider auth plugins
Co-authored-by: ItzR3NO <ItzR3NO@users.noreply.github.com>
This commit is contained in:
1 parent
b6ea5895b6
commit
a6deb0d9d5
31 files changed
+1485
-542
No files matched your search
@@ -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