Skip to content

Commit b05a3f9

Browse files
committed
Expand Invoke-Build aliases for consistency
1 parent ca052fc commit b05a3f9

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

vscode-powershell.build.ps1

+14-14
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ task RestoreNodeModules -If { !(Test-Path ./node_modules) } {
3131
# When in a CI build use the --loglevel=error parameter so that
3232
# package install warnings don't cause PowerShell to throw up
3333
if ($env:TF_BUILD) {
34-
exec { & npm ci --loglevel=error }
34+
Invoke-BuildExec { & npm ci --loglevel=error }
3535
} else {
36-
exec { & npm install }
36+
Invoke-BuildExec { & npm install }
3737
}
3838
}
3939

@@ -44,7 +44,7 @@ task RestoreEditorServices -If (Get-EditorServicesPath) {
4444
# that developers always have the latest local bits.
4545
if ((Get-Item ./modules -ErrorAction SilentlyContinue).LinkType -ne "SymbolicLink") {
4646
Write-Host "`n### Creating symbolic link to PSES" -ForegroundColor Green
47-
remove ./modules
47+
Remove-BuildItem ./modules
4848
New-Item -ItemType SymbolicLink -Path ./modules -Target "$(Split-Path (Get-EditorServicesPath))/module"
4949
}
5050

@@ -56,7 +56,7 @@ task RestoreEditorServices -If (Get-EditorServicesPath) {
5656
# and only if they don't already exist.
5757
if ((Get-Item ./modules -ErrorAction SilentlyContinue).LinkType -eq "SymbolicLink") {
5858
Write-Host "`n### Deleting PSES symbolic link" -ForegroundColor Green
59-
remove ./modules
59+
Remove-BuildItem ./modules
6060
}
6161

6262
if (!(Test-Path ./modules)) {
@@ -80,7 +80,7 @@ task Restore RestoreEditorServices, RestoreNodeModules
8080

8181
task Clean {
8282
Write-Host "`n### Cleaning vscode-powershell`n" -ForegroundColor Green
83-
remove ./modules, ./out, ./node_modules, *.vsix
83+
Remove-BuildItem ./modules, ./out, ./node_modules, *.vsix
8484
}
8585

8686
task CleanEditorServices -If (Get-EditorServicesPath) {
@@ -93,9 +93,9 @@ task CleanEditorServices -If (Get-EditorServicesPath) {
9393

9494
task Build Restore, {
9595
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"
9797

98-
exec { & npm run lint }
98+
Invoke-BuildExec { & npm run lint }
9999

100100
# TODO: When supported we should use `esbuild` for the tests too. Although
101101
# we now use `esbuild` to transpile, bundle, and minify the extension, we
@@ -104,8 +104,8 @@ task Build Restore, {
104104
# Unfortunately `esbuild` doesn't support emitting 1:1 files (yet).
105105
# https://github.com/evanw/esbuild/issues/944
106106
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 } }
109109
}
110110
}
111111

@@ -114,9 +114,9 @@ task Build Restore, {
114114

115115
task Test -If (!($env:TF_BUILD -and $global:IsLinux)) Build, {
116116
Write-Host "`n### Running extension tests" -ForegroundColor Green
117-
exec { & npm run test }
117+
Invoke-BuildExec { & npm run test }
118118
# 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}
120120
}
121121

122122
task TestEditorServices -If (Get-EditorServicesPath) {
@@ -129,11 +129,11 @@ task TestEditorServices -If (Get-EditorServicesPath) {
129129

130130
task Package Build, {
131131
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!"
133133
if ($script:PackageJson.preview) {
134-
exec { & npm run package -- --pre-release }
134+
Invoke-BuildExec { & npm run package -- --pre-release }
135135
} else {
136-
exec { & npm run package }
136+
Invoke-BuildExec { & npm run package }
137137
}
138138
}
139139

0 commit comments

Comments
 (0)