From 09794639b5994dc1948731bbf26ff99c144e801e Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Tue, 2 Jun 2026 07:35:19 +0200 Subject: [PATCH] Bugfix/environment variable expansion when debugging in Visual Studio Code (#6977) * Fix environment variable expansion * Update changelog --- .vscode/launch.json | 12 ++++++++++-- CHANGELOG.md | 4 ++++ tools/load-env.ts | 4 ++++ 3 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 tools/load-env.ts diff --git a/.vscode/launch.json b/.vscode/launch.json index c1f19e7f0..6d36314d2 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -18,12 +18,20 @@ "autoAttachChildProcesses": true, "console": "integratedTerminal", "cwd": "${workspaceFolder}/apps/api", - "envFile": "${workspaceFolder}/.env", + "env": { + "GHOSTFOLIO_ENV_FILE": "${workspaceFolder}/.env" + }, "name": "Debug API", "outFiles": ["${workspaceFolder}/dist/apps/api/**/*.js"], "program": "${workspaceFolder}/apps/api/src/main.ts", "request": "launch", - "runtimeArgs": ["--nolazy", "-r", "ts-node/register"], + "runtimeArgs": [ + "--nolazy", + "-r", + "ts-node/register", + "-r", + "${workspaceFolder}/tools/load-env.ts" + ], "skipFiles": [ "${workspaceFolder}/node_modules/**/*.js", "/**/*.js" diff --git a/CHANGELOG.md b/CHANGELOG.md index d094f394b..558cd64e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Extended the countries mapping in the data enhancer for asset profile data via _Trackinsight_ - Removed the deprecated attributes (`assetClass`, `assetClassLabel`, `assetSubClass`, `assetSubClassLabel`, `countries`, `currency`, `dataSource`, `holdings`, `name`, `sectors`, `symbol` and `url`) from the holdings of the portfolio details endpoint response +### Fixed + +- Fixed the environment variable expansion in the `.env` file when debugging via _Visual Studio Code_ + ## 3.6.0 - 2026-05-28 ### Added diff --git a/tools/load-env.ts b/tools/load-env.ts new file mode 100644 index 000000000..3dd0d03c7 --- /dev/null +++ b/tools/load-env.ts @@ -0,0 +1,4 @@ +import { config } from 'dotenv'; +import { expand } from 'dotenv-expand'; + +expand(config({ path: process.env.GHOSTFOLIO_ENV_FILE, quiet: true }));