diff --git a/scripts/lstV2Build.ps1 b/scripts/lstV2Build.ps1 index 90115a7..a1794f3 100644 --- a/scripts/lstV2Build.ps1 +++ b/scripts/lstV2Build.ps1 @@ -1,11 +1,32 @@ #This is only temp until we make the entire transtion over to just this app...... long time but working on build process -$lstv2Loc = "C:\Users\matthes01\Documents\lstV2" -$lstv2BuildsDir = Join-Path $lstv2Loc "builds" $scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Definition +$rootDir = Join-Path $scriptDir ".." $tmpLoc = Join-Path $scriptDir "\tmp" +$envFile = Join-Path $rootDir ".env" + +if (Test-Path $envFile) { + Write-Host "Loading environment variables from $envFile" + Get-Content $envFile | ForEach-Object { + if ($_ -match "^\s*([^#][^=]*)=(.*)$") { + $name = $matches[1].Trim() + $value = $matches[2].Trim() + [System.Environment]::SetEnvironmentVariable($name, $value) + } + } +} else { + Write-Host ".env file not found at $envFile" +} + +if (-not $env:LSTV2) { + Write-Warning "BUILD_NAME environment variable is not set. Please make sure you have entered the correct info the env" + exit 1 +} + +$lstv2Loc = $env:LSTV2 +$lstv2BuildsDir = Join-Path $lstv2Loc "builds" function Build-LstV2-And-Copy { if (Test-Path $tmpLoc) {