refactor(lstv2): moved the loc to .env file
This commit is contained in:
@@ -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
|
#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
|
$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Definition
|
||||||
|
$rootDir = Join-Path $scriptDir ".."
|
||||||
$tmpLoc = Join-Path $scriptDir "\tmp"
|
$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 {
|
function Build-LstV2-And-Copy {
|
||||||
if (Test-Path $tmpLoc) {
|
if (Test-Path $tmpLoc) {
|
||||||
|
|||||||
Reference in New Issue
Block a user