feat(release): support loading local .env in publish script

This commit is contained in:
2026-09-07 16:51:12 +02:00
parent 38c0a6dc12
commit 38a8a747c7
+11
View File
@@ -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) {