Skip to content

Commit

Permalink
EvergreenLibraryUpdate Fixes #488
Browse files Browse the repository at this point in the history
  • Loading branch information
chezzer64 committed Oct 10, 2023
1 parent fb3b498 commit c6e0b39
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 7 additions & 0 deletions Evergreen/Public/Export-EvergreenApp.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ function Export-EvergreenApp {
$InputObject += $Content
}

foreach ($AppLibInfo in $InputObject) {
if (([System.Uri]$AppLibInfo.URI).Host -like '*.dl.sourceforge.net') {
Write-Verbose "Normalise Sourceforge download mirror URL"
$AppLibInfo.URI = $AppLibInfo.URI -replace ([System.Uri]$AppLibInfo.URI).Host,"nchc.dl.sourceforge.net"
}
}

# Sort the content and keep unique versions
$Properties = $InputObject | Get-Member | `
Where-Object { $_.MemberType -eq "NoteProperty" } | Select-Object -ExpandProperty "Name" -Unique | `
Expand Down
3 changes: 2 additions & 1 deletion Evergreen/Public/Invoke-EvergreenLibraryUpdate.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ function Invoke-EvergreenLibraryUpdate {
}

# Gather the application version information from Get-EvergreenApp
[array]$App = @()
$App = Get-EvergreenApp -Name $Application.EvergreenApp @params | Where-Object $WhereBlock

# If something returned, add to the library
Expand All @@ -69,7 +70,7 @@ function Invoke-EvergreenLibraryUpdate {
# Add the saved installer path to the application version information
if ($Saved.Count -gt 1) {
for ($i = 0; $i -lt $App.Count; $i++) {
$Item = $Saved | Where-Object { $_.FullName -match $App[$i].Version }
$Item = $Saved | Where-Object { $_.FullName -match $App[$i].Version -and ((Split-Path $_.FullName -Leaf) -eq (Split-Path $App[$i].URI -Leaf)) }
Write-Verbose -Message "Add path to object: $($Item.FullName)"
$App[$i] | Add-Member -MemberType "NoteProperty" -Name "Path" -Value $Item.FullName
}
Expand Down

0 comments on commit c6e0b39

Please sign in to comment.