fix: restore reviewable migration evidence

This commit is contained in:
MiMoCode
2026-07-10 18:26:48 +08:00
commit d1bbb5370c
42 changed files with 6419 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
# Load KEY=VALUE pairs from .env into the current PowerShell process.
# Usage: . .\tests\scripts\load-env.ps1
param(
[string]$Path = ".env"
)
if (-not (Test-Path $Path)) {
Write-Error "env file not found: $Path"
return
}
Get-Content $Path | ForEach-Object {
$line = $_.Trim()
if ($line -eq "" -or $line.StartsWith("#")) { return }
$idx = $line.IndexOf("=")
if ($idx -lt 1) { return }
$key = $line.Substring(0, $idx).Trim()
$val = $line.Substring($idx + 1).Trim()
if (($val.StartsWith('"') -and $val.EndsWith('"')) -or
($val.StartsWith("'") -and $val.EndsWith("'"))) {
$val = $val.Substring(1, $val.Length - 2)
}
[Environment]::SetEnvironmentVariable($key, $val, "Process")
Write-Host " loaded $key"
}