@@ -39,7 +39,7 @@ task Restore -If { !(Test-Path "$PSScriptRoot/node_modules") } {
3939
4040task Clean {
4141 Write-Host " `n ### Cleaning vscode-powershell`n " - ForegroundColor Green
42- Remove-Item ./ modules - Exclude " README.md " - Recurse - Force - ErrorAction Ignore
42+ Remove-Item ./ modules - Recurse - Force - ErrorAction Ignore
4343 Remove-Item ./ out - Recurse - Force - ErrorAction Ignore
4444 Remove-Item ./ node_modules - Recurse - Force - ErrorAction Ignore
4545}
@@ -57,9 +57,15 @@ task BuildEditorServices -If (Get-EditorServicesPath) {
5757 Invoke-Build Build (Get-EditorServicesPath )
5858}
5959
60- task CopyEditorServices - If { ! (Test-Path ./ modules/ PowerShellEditorServices) -and (Get-EditorServicesPath ) } BuildEditorServices, {
61- Write-Host " `n ### Copying PowerShellEditorServices module files" - ForegroundColor Green
62- Copy-Item - Recurse - Force " $ ( Split-Path (Get-EditorServicesPath )) /module/*" ./ modules
60+ task LinkEditorServices - If (Get-EditorServicesPath ) BuildEditorServices, {
61+ Write-Host " `n ### For developer use only! Creating symbolic link to PSES" - ForegroundColor Green
62+ Remove-Item ./ modules - Recurse - Force - ErrorAction Ignore
63+ New-Item - ItemType SymbolicLink - Path ./ modules - Target " $ ( Split-Path (Get-EditorServicesPath )) /module"
64+ }
65+
66+ task CopyEditorServices - If { ! (Test-Path ./ modules) -and (Get-EditorServicesPath ) } BuildEditorServices, {
67+ Write-Host " `n ### Copying PSES" - ForegroundColor Green
68+ Copy-Item - Recurse - Force " $ ( Split-Path (Get-EditorServicesPath )) /module" ./ modules
6369}
6470
6571task Build CopyEditorServices, Restore, {
@@ -111,7 +117,9 @@ task UpdateReadme -If { $script:IsPreviewExtension } {
111117}
112118
113119task Package UpdateReadme, Build, {
114- assert { Test-Path ./ modules/ PowerShellEditorServices }
120+ assert (Test-Path ./ modules/ PowerShellEditorServices)
121+ assert ((Get-Item ./ modules).LinkType -ne " SymbolicLink" ) " Packaging requires a copy of PSES, not a symlink!"
122+
115123 Write-Host " `n ### Packaging $ ( $script :PackageJson.name ) -$ ( $script :PackageJson.version ) .vsix`n " - ForegroundColor Green
116124 exec { & npm run package }
117125}
0 commit comments