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) {