Skip to content

Have build script add dependent modules (PSSA & Plaster) #1239

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Mar 23, 2018
9 changes: 8 additions & 1 deletion vscode-powershell.build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ task ResolveEditorServicesPath -Before CleanEditorServices, BuildEditorServices
}
}

task Restore -If { "Restore" -in $BuildTask -or !(Test-Path "./node_modules") } -Before Build {
task Restore RestoreNodeModules, RestorePowerShellModules -Before Build

task RestoreNodeModules -If { -not (Test-Path "$PSScriptRoot/node_modules") } {

Write-Host "`n### Restoring vscode-powershell dependencies`n" -ForegroundColor Green

Expand All @@ -63,6 +65,11 @@ task Restore -If { "Restore" -in $BuildTask -or !(Test-Path "./node_modules") }
exec { & npm install $logLevelParam }
}

task RestorePowerShellModules -If { -not (Test-Path "$PSScriptRoot/modules/Plaster") } {
Save-Module -Name Plaster -Path "$PSScriptRoot/modules/"
Save-Module -Name PSScriptAnalyzer -Path "$PSScriptRoot/modules/"
}

task Clean {
Write-Host "`n### Cleaning vscode-powershell`n" -ForegroundColor Green
Remove-Item .\out -Recurse -Force -ErrorAction Ignore
Expand Down