@@ -39,7 +39,7 @@ task Restore -If { !(Test-Path "$PSScriptRoot/node_modules") } {
39
39
40
40
task Clean {
41
41
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
43
43
Remove-Item ./ out - Recurse - Force - ErrorAction Ignore
44
44
Remove-Item ./ node_modules - Recurse - Force - ErrorAction Ignore
45
45
}
@@ -57,9 +57,15 @@ task BuildEditorServices -If (Get-EditorServicesPath) {
57
57
Invoke-Build Build (Get-EditorServicesPath )
58
58
}
59
59
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
63
69
}
64
70
65
71
task Build CopyEditorServices, Restore, {
@@ -111,7 +117,9 @@ task UpdateReadme -If { $script:IsPreviewExtension } {
111
117
}
112
118
113
119
task 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
+
115
123
Write-Host " `n ### Packaging $ ( $script :PackageJson.name ) -$ ( $script :PackageJson.version ) .vsix`n " - ForegroundColor Green
116
124
exec { & npm run package }
117
125
}
0 commit comments