From 915ccb5dbce9780e57014c13c43d168ef817b9c1 Mon Sep 17 00:00:00 2001 From: Kevin Marquette Date: Tue, 16 Oct 2018 09:09:10 -0700 Subject: [PATCH] add better handling of $null values when setting the version --- BuildTasks/SetVersion.Task.ps1 | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/BuildTasks/SetVersion.Task.ps1 b/BuildTasks/SetVersion.Task.ps1 index bb023f7..1587856 100644 --- a/BuildTasks/SetVersion.Task.ps1 +++ b/BuildTasks/SetVersion.Task.ps1 @@ -62,14 +62,10 @@ task SetVersion { "Downloading published module to check for breaking changes" $publishedModule | Save-Module -Path $downloadFolder - [System.Collections.Generic.HashSet[string]] $publishedInterface = GetModulePublicInterfaceMap -Path (Join-Path $downloadFolder $ModuleName) - [System.Collections.Generic.HashSet[string]] $buildInterface = GetModulePublicInterfaceMap -Path $ManifestPath - if ($null -eq $publishedInterface) - { - $publishedInterface = [System.Collections.Generic.HashSet[string]]::new() - } + [System.Collections.Generic.HashSet[string]] $publishedInterface = @(GetModulePublicInterfaceMap -Path (Join-Path $downloadFolder $ModuleName)) + [System.Collections.Generic.HashSet[string]] $buildInterface = @(GetModulePublicInterfaceMap -Path $ManifestPath) - if( -not $publishedInterface.IsSubsetOf($buildInterface)) + if (-not $publishedInterface.IsSubsetOf($buildInterface)) { $bumpVersionType = 'Major' }