Skip to content

Commit

Permalink
Fix IncludeStream argument when only one is passed
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Démoulins committed Nov 9, 2017
1 parent 61bb507 commit daf04b5
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions AU/Public/Update-Package.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -393,10 +393,8 @@ function Update-Package {
$res_type = $res.GetType()
if ($res_type -ne [HashTable]) { throw "au_GetLatest doesn't return a HashTable result but $res_type" }

if ($global:au_Force) {
$Force = $true
if ($global:au_IncludeStream) { $IncludeStream = $global:au_IncludeStream }
}
if ($global:au_Force) { $Force = $true }
if ($global:au_IncludeStream) { $IncludeStream = $global:au_IncludeStream }
} catch {
throw "au_GetLatest failed`n$_"
}
Expand Down Expand Up @@ -428,7 +426,7 @@ function Update-Package {
}
if ($Force -and (!$IncludeStream -or $IncludeStream.Length -ne 1)) { throw 'A single stream must be included when forcing package update' }

if ($IncludeStream) { $streams = $streams | ? { $_ -in $IncludeStream } }
if ($IncludeStream) { $streams = @($streams | ? { $_ -in $IncludeStream }) }
# Let's reverse the order in order to process streams starting with the oldest one
[Array]::Reverse($streams)

Expand Down

0 comments on commit daf04b5

Please sign in to comment.