Skip to content

Commit 190fa6a

Browse files
corbobTylerLeonhardt
authored andcommitted
Update build to clear node modules directory (#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 fc0d52b commit 190fa6a

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

Diff for: package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -508,8 +508,8 @@
508508
"description": "Specifies the visibility of the Command Explorer in the PowerShell Side Bar."
509509
},
510510
"powershell.sideBar.CommandExplorerExcludeFilter": {
511-
"type":"array",
512-
"default":[],
511+
"type": "array",
512+
"default": [],
513513
"description": "Specify array of Modules to exclude from Command Explorer listing."
514514
},
515515
"powershell.powerShellExePath": {

Diff for: vscode-powershell.build.ps1

+3-2
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ task ResolveEditorServicesPath -Before CleanEditorServices, BuildEditorServices,
6060
}
6161
}
6262

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

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

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

@@ -76,6 +76,7 @@ task Clean {
7676
Write-Host "`n### Cleaning vscode-powershell`n" -ForegroundColor Green
7777
Remove-Item .\modules\* -Exclude "README.md" -Recurse -Force -ErrorAction Ignore
7878
Remove-Item .\out -Recurse -Force -ErrorAction Ignore
79+
exec { & npm prune }
7980
}
8081

8182
task CleanEditorServices {

0 commit comments

Comments
 (0)