add better handling of $null values when setting the version

This commit is contained in:
Kevin Marquette
2018-10-16 09:09:10 -07:00
parent e7e2612082
commit 915ccb5dbc

View File

@@ -62,14 +62,10 @@ task SetVersion {
"Downloading published module to check for breaking changes" "Downloading published module to check for breaking changes"
$publishedModule | Save-Module -Path $downloadFolder $publishedModule | Save-Module -Path $downloadFolder
[System.Collections.Generic.HashSet[string]] $publishedInterface = GetModulePublicInterfaceMap -Path (Join-Path $downloadFolder $ModuleName) [System.Collections.Generic.HashSet[string]] $publishedInterface = @(GetModulePublicInterfaceMap -Path (Join-Path $downloadFolder $ModuleName))
[System.Collections.Generic.HashSet[string]] $buildInterface = GetModulePublicInterfaceMap -Path $ManifestPath [System.Collections.Generic.HashSet[string]] $buildInterface = @(GetModulePublicInterfaceMap -Path $ManifestPath)
if ($null -eq $publishedInterface)
{
$publishedInterface = [System.Collections.Generic.HashSet[string]]::new()
}
if( -not $publishedInterface.IsSubsetOf($buildInterface)) if (-not $publishedInterface.IsSubsetOf($buildInterface))
{ {
$bumpVersionType = 'Major' $bumpVersionType = 'Major'
} }