Skip to content

Commit 30b3dc7

Browse files
kaysonwuzobo
authored andcommitted
fix: merge environment variables for #705 (#706)
* fix: Merge environment variables for #705
1 parent 7c8529a commit 30b3dc7

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).
66

7+
## [1.23.0]
8+
9+
- When `env` is specified in launch configuration it will be merged the process environment.
10+
711
## [1.22.0]
812

913
### Added

src/phpDebug.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,10 @@ class PhpDebugSession extends vscode.DebugSession {
259259
const program = args.program ? [args.program] : []
260260
const cwd = args.cwd || process.cwd()
261261
const env = Object.fromEntries(
262-
Object.entries(args.env || process.env).map(v => [v[0], v[1]?.replace('${port}', port.toString())])
262+
Object.entries({ ...process.env, ...args.env }).map(v => [
263+
v[0],
264+
v[1]?.replace('${port}', port.toString()),
265+
])
263266
)
264267
// launch in CLI mode
265268
if (args.externalConsole) {

0 commit comments

Comments
 (0)