From f96a6beaedce2a8d7c965a213bbc4a0bbb0c06e0 Mon Sep 17 00:00:00 2001 From: Noam Cohen Date: Wed, 20 Nov 2024 16:48:28 +0200 Subject: [PATCH] explicitly disable plugin when `MIRRORD_ACTIVE=0` (#155) --- changelog.d/+explicitly-disable-from-env.added.md | 1 + src/debugger.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changelog.d/+explicitly-disable-from-env.added.md diff --git a/changelog.d/+explicitly-disable-from-env.added.md b/changelog.d/+explicitly-disable-from-env.added.md new file mode 100644 index 00000000..175f9795 --- /dev/null +++ b/changelog.d/+explicitly-disable-from-env.added.md @@ -0,0 +1 @@ +Setting `MIRRORD_ACTIVE=0` environment variable will explicitly disable mirrord. diff --git a/src/debugger.ts b/src/debugger.ts index f5ff2f7f..135cedec 100644 --- a/src/debugger.ts +++ b/src/debugger.ts @@ -81,7 +81,7 @@ async function main( folder: vscode.WorkspaceFolder | undefined, config: vscode.DebugConfiguration, _token: vscode.CancellationToken): Promise { - if (!globalContext.workspaceState.get('enabled') && !(config.env?.["MIRRORD_ACTIVE"] === "1")) { + if ((!globalContext.workspaceState.get('enabled') && !(config.env?.["MIRRORD_ACTIVE"] === "1")) || config.env?.["MIRRORD_ACTIVE"] === "0") { return config; }