@@ -31,9 +31,9 @@ task RestoreNodeModules -If { !(Test-Path ./node_modules) } {
31
31
# When in a CI build use the --loglevel=error parameter so that
32
32
# package install warnings don't cause PowerShell to throw up
33
33
if ($env: TF_BUILD ) {
34
- exec { & npm ci -- loglevel= error }
34
+ Invoke-BuildExec { & npm ci -- loglevel= error }
35
35
} else {
36
- exec { & npm install }
36
+ Invoke-BuildExec { & npm install }
37
37
}
38
38
}
39
39
@@ -44,7 +44,7 @@ task RestoreEditorServices -If (Get-EditorServicesPath) {
44
44
# that developers always have the latest local bits.
45
45
if ((Get-Item ./ modules - ErrorAction SilentlyContinue).LinkType -ne " SymbolicLink" ) {
46
46
Write-Host " `n ### Creating symbolic link to PSES" - ForegroundColor Green
47
- remove ./ modules
47
+ Remove-BuildItem ./ modules
48
48
New-Item - ItemType SymbolicLink - Path ./ modules - Target " $ ( Split-Path (Get-EditorServicesPath )) /module"
49
49
}
50
50
@@ -56,7 +56,7 @@ task RestoreEditorServices -If (Get-EditorServicesPath) {
56
56
# and only if they don't already exist.
57
57
if ((Get-Item ./ modules - ErrorAction SilentlyContinue).LinkType -eq " SymbolicLink" ) {
58
58
Write-Host " `n ### Deleting PSES symbolic link" - ForegroundColor Green
59
- remove ./ modules
59
+ Remove-BuildItem ./ modules
60
60
}
61
61
62
62
if (! (Test-Path ./ modules)) {
@@ -80,7 +80,7 @@ task Restore RestoreEditorServices, RestoreNodeModules
80
80
81
81
task Clean {
82
82
Write-Host " `n ### Cleaning vscode-powershell`n " - ForegroundColor Green
83
- remove ./ modules, ./ out, ./ node_modules, * .vsix
83
+ Remove-BuildItem ./ modules, ./ out, ./ node_modules, * .vsix
84
84
}
85
85
86
86
task CleanEditorServices - If (Get-EditorServicesPath ) {
@@ -93,9 +93,9 @@ task CleanEditorServices -If (Get-EditorServicesPath) {
93
93
94
94
task Build Restore, {
95
95
Write-Host " `n ### Building vscode-powershell`n " - ForegroundColor Green
96
- assert (Test-Path ./ modules/ PowerShellEditorServices/ bin) " Extension requires PSES"
96
+ Assert-Build (Test-Path ./ modules/ PowerShellEditorServices/ bin) " Extension requires PSES"
97
97
98
- exec { & npm run lint }
98
+ Invoke-BuildExec { & npm run lint }
99
99
100
100
# TODO: When supported we should use `esbuild` for the tests too. Although
101
101
# we now use `esbuild` to transpile, bundle, and minify the extension, we
@@ -104,8 +104,8 @@ task Build Restore, {
104
104
# Unfortunately `esbuild` doesn't support emitting 1:1 files (yet).
105
105
# https://github.com/evanw/esbuild/issues/944
106
106
switch ($Configuration ) {
107
- " Debug" { exec { & npm run build -- -- sourcemap } }
108
- " Release" { exec { & npm run build -- -- minify } }
107
+ " Debug" { Invoke-BuildExec { & npm run build -- -- sourcemap } }
108
+ " Release" { Invoke-BuildExec { & npm run build -- -- minify } }
109
109
}
110
110
}
111
111
@@ -114,9 +114,9 @@ task Build Restore, {
114
114
115
115
task Test - If (! ($env: TF_BUILD -and $global :IsLinux )) Build, {
116
116
Write-Host " `n ### Running extension tests" - ForegroundColor Green
117
- exec { & npm run test }
117
+ Invoke-BuildExec { & npm run test }
118
118
# Reset the state of files modified by tests
119
- exec { git checkout package.json test/ .vscode/ settings.json}
119
+ Invoke-BuildExec { git checkout package.json test/ .vscode/ settings.json}
120
120
}
121
121
122
122
task TestEditorServices - If (Get-EditorServicesPath ) {
@@ -129,11 +129,11 @@ task TestEditorServices -If (Get-EditorServicesPath) {
129
129
130
130
task Package Build, {
131
131
Write-Host " `n ### Packaging $ ( $script :PackageJson.name ) -$ ( $script :PackageJson.version ) .vsix`n " - ForegroundColor Green
132
- assert ((Get-Item ./ modules).LinkType -ne " SymbolicLink" ) " Packaging requires a copy of PSES, not a symlink!"
132
+ Assert-Build ((Get-Item ./ modules).LinkType -ne " SymbolicLink" ) " Packaging requires a copy of PSES, not a symlink!"
133
133
if ($script :PackageJson.preview ) {
134
- exec { & npm run package -- -- pre- release }
134
+ Invoke-BuildExec { & npm run package -- -- pre- release }
135
135
} else {
136
- exec { & npm run package }
136
+ Invoke-BuildExec { & npm run package }
137
137
}
138
138
}
139
139
0 commit comments