This commit is contained in:
@kirill.komarov
2026-05-10 16:49:55 +05:00
parent f56d6a79fb
commit e67d8bdc0a
10 changed files with 935 additions and 113 deletions
+14
View File
@@ -0,0 +1,14 @@
function Import-DeployDotEnv {
param([string]$Path)
if (-not (Test-Path $Path)) { return }
Get-Content $Path | ForEach-Object {
if ($_ -match '^\s*#' -or $_ -match '^\s*$') { return }
if ($_ -match '^([A-Za-z_][A-Za-z0-9_]*)=(.*)$') {
$name = $Matches[1]; $raw = $Matches[2].Trim()
$v = $raw
if ($raw.StartsWith("'") -and $raw.EndsWith("'")) { $v = $raw.Trim("'") }
elseif ($raw.StartsWith('"') -and $raw.EndsWith('"')) { $v = $raw.Trim('"') }
[Environment]::SetEnvironmentVariable($name, $v, "Process")
}
}
}