Skip to content

Commit

Permalink
Merge pull request majkinetor#113 from Thilas/fix-no-streams
Browse files Browse the repository at this point in the history
Fix case when a package with streams does not have yet its json file
  • Loading branch information
Thilas authored Nov 9, 2017
2 parents dfff548 + 165ca51 commit 3ccd9db
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion AU/Public/Update-Package.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@ function Update-Package {
$res.Keys | ? { $_ -ne 'Streams' } | % { $global:au_Latest.Remove($_) }
$global:au_Latest += $res

$allStreams = [ordered] @{}
$streams | % {
$stream = $res.Streams[$_]

Expand All @@ -451,9 +452,15 @@ function Update-Package {
set_latest $stream $package.Streams.$_.NuspecVersion $_
process_stream

$package.Streams.$_ += $package.GetStreamDetails()
if ($package.Streams.$_) {
$allStreams.$_ = $package.Streams.$_
} else {
$allStreams.$_ = @{ NuspecVersion = $package.NuspecVersion }
}
$allStreams.$_ += $package.GetStreamDetails()
}
$package.Updated = $false
$package.Streams = $allStreams
$package.Streams.Values | ? { $_.Updated } | % { $package.Updated = $true }
} else {
'' | result
Expand Down

0 comments on commit 3ccd9db

Please sign in to comment.