Skip to content

Commit e406d2c

Browse files
corbobTylerLeonhardt
authored andcommitted
Update build to clear node modules directory (PowerShell#1741)
* Update build to clear node modules Add removal of the node_modules directory on Clean task. Move condition for restore to the build prerequisite. This allows the restoring of node modules even if the folder exists. * Don't remove node_modules. This causes bad things to happen when you're editing in vscode (@types is locked until code exits) Next best thing might be to npm prune (or maybe npm install?) * npm install keeps putting these spaces in...
1 parent f386524 commit e406d2c

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -503,8 +503,8 @@
503503
"description": "Specifies the visibility of the Command Explorer in the PowerShell Side Bar."
504504
},
505505
"powershell.sideBar.CommandExplorerExcludeFilter": {
506-
"type":"array",
507-
"default":[],
506+
"type": "array",
507+
"default": [],
508508
"description": "Specify array of Modules to exclude from Command Explorer listing."
509509
},
510510
"powershell.powerShellExePath": {

vscode-powershell.build.ps1

+3-2
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ task ResolveEditorServicesPath -Before CleanEditorServices, BuildEditorServices
5757
}
5858
}
5959

60-
task Restore RestoreNodeModules -Before Build
60+
task Restore RestoreNodeModules -Before Build -If { -not (Test-Path "$PSScriptRoot/node_modules") }
6161

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

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

@@ -73,6 +73,7 @@ task Clean {
7373
Write-Host "`n### Cleaning vscode-powershell`n" -ForegroundColor Green
7474
Remove-Item .\modules\* -Exclude "README.md" -Recurse -Force -ErrorAction Ignore
7575
Remove-Item .\out -Recurse -Force -ErrorAction Ignore
76+
exec { & npm prune }
7677
}
7778

7879
task CleanEditorServices {

0 commit comments

Comments
 (0)