From 38a8a747c7c59053c7e2b14f208463cb22cc8d78 Mon Sep 17 00:00:00 2001 From: harald Date: Mon, 7 Sep 2026 16:51:12 +0200 Subject: [PATCH] feat(release): support loading local .env in publish script --- scripts/publish-release.ps1 | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/scripts/publish-release.ps1 b/scripts/publish-release.ps1 index a6e2787..baff886 100644 --- a/scripts/publish-release.ps1 +++ b/scripts/publish-release.ps1 @@ -27,6 +27,17 @@ if (-not (Test-Path $ZipFile)) { & (Join-Path $ScriptDir "package-release.ps1") } +# .env-Datei laden falls vorhanden (ist in .gitignore) +$EnvFile = Join-Path $ProjectRoot ".env" +if (Test-Path $EnvFile) { + Get-Content $EnvFile | ForEach-Object { + if ($_ -match '^\s*([A-Za-z_][A-Za-z0-9_]*)\s*=\s*(.*)\s*$') { + $val = $matches[2].Trim('"', "'") + [System.Environment]::SetEnvironmentVariable($matches[1], $val, "Process") + } + } +} + # Token ermitteln (Parameter -> Environment -> Prompt) if (-not $Token) { if ($env:GITEA_TOKEN) {