Skip to content

Commit

Permalink
Changed sorting of tracked version in comment
Browse files Browse the repository at this point in the history
  • Loading branch information
AdmiringWorm committed Jun 25, 2020
1 parent df49ce1 commit b498f72
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions scripts/private/Update-StatusComment.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,23 @@

if ($statusData -and $statusData.Count -gt 0) {
$statusData | % {
$firstVersion = $_.versions | select -First 1
if ($firstVersion) {
$comment = "$comment`n- [$($_.name)]($($firstVersion.url)) (Status: $($firstVersion.status), Listed: $($firstVersion.listed), Is New: $($firstVersion.isNew), Version: $($firstVersion.version))"
$lowestStatusVersion = $_.versions | sort {
if ($_.status -eq 'waiting') {
0
}
elseif ($_.status -eq 'submitted') {
1
}
elseif ($_.status -eq 'approved' -or $_.status -eq 'exempted') {
2
}
else {
3
}
}
$lowestStatusVersion = $_.versions | select -First 1
if ($lowestStatusVersion) {
$comment = "$comment`n- [$($_.name)]($($lowestStatusVersion.url)) (Status: $($lowestStatusVersion.status), Listed: $($lowestStatusVersion.listed), Is New: $($lowestStatusVersion.isNew), Version: $($lowestStatusVersion.version))"
}
else {
$comment = "$comment`n- **$($_.name)** (Status: Missing)"
Expand Down

0 comments on commit b498f72

Please sign in to comment.