Skip to content

Commit d02898a

Browse files
committed
Minor cleanup of .build.ps1
1 parent bd3b3f6 commit d02898a

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

.build.ps1

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
#
2+
# Copyright (c) Microsoft. All rights reserved.
3+
# Licensed under the MIT license. See LICENSE file in the project root for full license information.
4+
#
5+
16
param(
27
[ValidateSet("Debug", "Release")]
38
[string]$Configuration = "Debug"
@@ -10,14 +15,11 @@ $script:IsUnix = $PSVersionTable.PSEdition -and $PSVersionTable.PSEdition -eq "C
1015
$script:TargetFrameworksParam = "/p:TargetFrameworks=\`"$(if (!$script:IsUnix) { "net451;" })netstandard1.6\`""
1116

1217
if ($PSVersionTable.PSEdition -ne "Core") {
13-
Add-Type -Assembly System.IO.Compression.FileSystem -ErrorAction SilentlyContinue
18+
Add-Type -Assembly System.IO.Compression.FileSystem
1419
}
1520

1621
task SetupDotNet -Before Restore, Clean, Build, BuildHost, Test, TestPowerShellApi, PackageNuGet {
1722

18-
# Bail out early if we've already found the exe path
19-
if ($script:dotnetExe -ne $null) { return }
20-
2123
# Fetch the SDK version from global.json
2224
$globalJson = Get-Content $PSScriptRoot/global.json | ConvertFrom-Json
2325
$requiredSdkVersion = $globalJson.sdk.version
@@ -93,12 +95,12 @@ task Restore {
9395

9496
task Clean {
9597
exec { & $script:dotnetExe clean }
98+
Remove-Item .\module\PowerShellEditorServices\bin -Recurse -Force -ErrorAction Ignore
9699
Get-ChildItem -Recurse src\*.nupkg | Remove-Item -Force -ErrorAction Ignore
97-
Get-ChildItem module\*.zip | Remove-Item -Force -ErrorAction Ignore
100+
Get-ChildItem .\module\PowerShellEditorServices\*.zip | Remove-Item -Force -ErrorAction Ignore
98101
}
99102

100103
task GetProductVersion -Before PackageNuGet, PackageModule, UploadArtifacts {
101-
if ($script:BaseVersion) { return }
102104
[xml]$props = Get-Content .\PowerShellEditorServices.Common.props
103105

104106
$script:VersionSuffix = $props.Project.PropertyGroup.VersionSuffix

0 commit comments

Comments
 (0)