Skip to content
This repository has been archived by the owner on Oct 25, 2022. It is now read-only.

Commit

Permalink
Merge pull request #117 from Thilas/fix-nuspecversion
Browse files Browse the repository at this point in the history
Fix NuspecVersion returned by Update-Package for updated streams
  • Loading branch information
Thilas authored Nov 18, 2017
2 parents 92659af + 431d1cf commit 888ad3a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
7 changes: 2 additions & 5 deletions AU/Public/Update-Package.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -452,11 +452,8 @@ function Update-Package {
set_latest $stream $package.Streams.$_.NuspecVersion $_
process_stream

if ($package.Streams.$_) {
$allStreams.$_ = $package.Streams.$_
} else {
$allStreams.$_ = @{ NuspecVersion = $package.NuspecVersion }
}
$allStreams.$_ = if ($package.Streams.$_) { $package.Streams.$_.Clone() } else { @{} }
$allStreams.$_.NuspecVersion = $package.NuspecVersion
$allStreams.$_ += $package.GetStreamDetails()
}
$package.Updated = $false
Expand Down
3 changes: 3 additions & 0 deletions tests/Update-Package.Streams.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,11 @@ Describe 'Update-Package using streams' -Tag updatestreams {
$res = update

$res.Updated | Should Be $true
$res.Streams.'1.2'.NuspecVersion | Should Be 1.2.3
$res.Streams.'1.2'.RemoteVersion | Should Be 1.2.4
$res.Streams.'1.3'.NuspecVersion | Should Be 1.3.1
$res.Streams.'1.3'.RemoteVersion | Should Be 1.3.1
$res.Streams.'1.4'.NuspecVersion | Should Be 1.4-beta1
$res.Streams.'1.4'.RemoteVersion | Should Be 1.4.0
$res.Result[-1] | Should Be 'Package updated'
(json_file).'1.2' | Should Be 1.2.4
Expand Down

0 comments on commit 888ad3a

Please sign in to comment.