From 2749fb3f0979219873ac4b6ca5490ea4c1ae2961 Mon Sep 17 00:00:00 2001 From: Ervin Kurushi Date: Fri, 2 Sep 2022 20:48:26 +0200 Subject: [PATCH] Added support for env variables in configurations --- package.json | 5 +++++ src/rubyDebug.ts | 2 ++ 2 files changed, 7 insertions(+) diff --git a/package.json b/package.json index 0418498..bce21e5 100644 --- a/package.json +++ b/package.json @@ -103,6 +103,11 @@ "type": "boolean", "description": "Start the debugger with Bundler", "default": false + }, + "env": { + "type": "object", + "description": "Environment variables passed to the program", + "default": {} } } } diff --git a/src/rubyDebug.ts b/src/rubyDebug.ts index 6d59ab1..bbea7c5 100644 --- a/src/rubyDebug.ts +++ b/src/rubyDebug.ts @@ -23,6 +23,8 @@ export class RubyDebugAdapterDescriptorFactory implements vscode.DebugAdapterDes reject(err); }); + Object.assign(process.env, session.configuration.env); + if (session.configuration.request === 'attach') { let host = session.configuration.host || '127.0.0.1'; let port = session.configuration.port || 1234;