fix setup environment for node tools
This commit is contained in:
@@ -11,14 +11,28 @@ function Initialize-PowerShellEnvironment {
|
||||
function Initialize-GenerateTools {
|
||||
Write-Host "Initializing Node.js dependencies..." -ForegroundColor Yellow
|
||||
|
||||
Push-Location -StackName NodeTools (Join-Path $PSScriptRoot "../scripts/")
|
||||
Push-Location -StackName NodeTools (Join-Path $PSScriptRoot "../tools/")
|
||||
|
||||
Get-childitem -Path . -Directory | ForEach-Object {
|
||||
Write-Host "Initializing $($_.Name)..." -ForegroundColor Cyan
|
||||
|
||||
Push-Location -StackName NodeTools $_.FullName
|
||||
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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user