feat(release): support loading local .env in publish script
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user