fix setup environment for node tools
This commit is contained in:
@@ -11,13 +11,27 @@ function Initialize-PowerShellEnvironment {
|
|||||||
function Initialize-GenerateTools {
|
function Initialize-GenerateTools {
|
||||||
Write-Host "Initializing Node.js dependencies..." -ForegroundColor Yellow
|
Write-Host "Initializing Node.js dependencies..." -ForegroundColor Yellow
|
||||||
|
|
||||||
Push-Location -StackName NodeTools (Join-Path $PSScriptRoot "../scripts/")
|
Push-Location -StackName NodeTools (Join-Path $PSScriptRoot "../tools/")
|
||||||
|
|
||||||
# Install Node.js dependencies
|
Get-childitem -Path . -Directory | ForEach-Object {
|
||||||
& npm install
|
Write-Host "Initializing $($_.Name)..." -ForegroundColor Cyan
|
||||||
if ($LASTEXITCODE -ne 0) {
|
|
||||||
Write-Error "npm install failed with exit code $LASTEXITCODE."
|
Push-Location -StackName NodeTools $_.FullName
|
||||||
exit 1
|
try {
|
||||||
|
# Install Node.js dependencies
|
||||||
|
& npm install
|
||||||
|
if ($LASTEXITCODE -ne 0) {
|
||||||
|
Write-Error "npm install failed with exit code $LASTEXITCODE."
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch {
|
||||||
|
Write-Error "npm install failed for $($_.Name): $_"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
Pop-Location -StackName NodeTools
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Pop-Location -StackName NodeTools
|
Pop-Location -StackName NodeTools
|
||||||
|
|||||||
Reference in New Issue
Block a user