Skip to content

Commit 2cf815e

Browse files
committed
Do not expose .env content
1 parent 8134536 commit 2cf815e

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

scripts/load-env.ps1

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
1+
param (
2+
[switch]$Verbose
3+
)
4+
15
Get-Content "$PSScriptRoot\..\.env" | ForEach-Object {
26
if ($_ -match '^(.*?)=(.*)$') {
37
$key = $matches[1].Trim()
48
$value = $matches[2].Trim()
5-
Write-Host "Setting environment variable: $key=$value" -ForegroundColor Green
9+
10+
if ($Verbose) {
11+
Write-Host "Setting environment variable: $Key=$value" -ForegroundColor Green
12+
}
13+
else {
14+
Write-Host "Setting environment variable: $Key=********" -ForegroundColor Green
15+
}
616
Set-Item "env:$key" $value
717
}
818
}

0 commit comments

Comments
 (0)