36 lines
1.1 KiB
PowerShell
36 lines
1.1 KiB
PowerShell
function Save-ElxInternals {
|
|
param(
|
|
[ValidateScript({ Test-Path $_ -PathType Leaf })][Parameter(Mandatory)]$ModulePath
|
|
)
|
|
|
|
Write-Host "Switching to ELX Tools directory..."
|
|
|
|
$extractElxToolsScriptPath = Join-Path $PSScriptRoot "../tools/extract-elx/"
|
|
Push-Location -StackName ElxTools $extractElxToolsScriptPath
|
|
|
|
Write-Host "Installing Node.js dependencies for the ELX Tools..."
|
|
|
|
# Install Node.js dependencies for the ELX Tools
|
|
& npm install
|
|
if ($LASTEXITCODE -ne 0) {
|
|
Write-Error "npm install failed with exit code $LASTEXITCODE."
|
|
exit 1
|
|
}
|
|
|
|
Write-Host "Node.js dependencies installed successfully!" -ForegroundColor Cyan
|
|
Write-Host "Executing ELX extraction..."
|
|
|
|
& node "extract-elx.js" $ModulePath --clean
|
|
if ($LASTEXITCODE -ne 0) {
|
|
Write-Error "ELX extraction failed with exit code $LASTEXITCODE."
|
|
exit 1
|
|
}
|
|
|
|
Write-Host "ELX extraction completed successfully!" -ForegroundColor Green
|
|
Write-Host "Switching back to original directory..."
|
|
|
|
Pop-Location -StackName ElxTools
|
|
}
|
|
|
|
Export-ModuleMember -Function Save-ElxInternals
|