From 6915b4b0af52487305a1af3ef9d6ae7d493b8c77 Mon Sep 17 00:00:00 2001 From: Ilia Babanov Date: Thu, 2 May 2024 14:17:30 +0200 Subject: [PATCH] Export CLI_UPSTREAM vars to terminals (#1215) Export CLI_UPSTREAM vars to terminals --- packages/databricks-vscode/src/extension.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/databricks-vscode/src/extension.ts b/packages/databricks-vscode/src/extension.ts index 297ca0ec5..28a6ec794 100644 --- a/packages/databricks-vscode/src/extension.ts +++ b/packages/databricks-vscode/src/extension.ts @@ -183,6 +183,16 @@ export async function activate( `${path.delimiter}${context.asAbsolutePath("./bin")}` ); + // Export CLI_UPSTREAM vars to the terminal to see if extension users use the CLI directly + context.environmentVariableCollection.replace( + "DATABRICKS_CLI_UPSTREAM", + "databricks-vscode-terminal" + ); + context.environmentVariableCollection.replace( + "DATABRICKS_CLI_UPSTREAM_VERSION", + packageMetadata.version + ); + // We always use bundled terraform and databricks provider. // Updating environment collection means that the variables will be set in all terminals. // If users use different CLI version in their terminal it will only pick the variables if