Skip to content

Commit

Permalink
Used most recent stream by default when forcing update
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Démoulins committed Oct 21, 2017
1 parent 9a176a6 commit 2c7fdcd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions AU/Public/Update-Package.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ function Update-Package {
$Include,

#Force package update even if no new version is found.
#For multi streams packages, most recent stream is checked by default when Force is specified.
[switch] $Force,

#Do not show any Write-Host output.
Expand Down Expand Up @@ -390,6 +391,8 @@ function Update-Package {
if ($Include) {
if ($Include -isnot [string] -and $Include -isnot [Array]) { throw "`$Include must be either a String or an Array but is $($Include.GetType())" }
if ($Include -is [string]) { [Array] $Include = $Include -split ',' | foreach { ,$_.Trim() } }
} elseif ($Force) {
$Include = @($res.Streams.Keys | sort { [AUVersion]$_ } -Descending | select -First 1)
}
if ($Force -and (!$Include -or $Include.Length -ne 1)) { throw 'A single stream must be included when forcing package update' }

Expand Down

0 comments on commit 2c7fdcd

Please sign in to comment.