Skip to content

Commit

Permalink
Merge pull request #2306 from JPRuskin/fix-nomacs
Browse files Browse the repository at this point in the history
(nomacs) Fixes Update.ps1 (HTML Parsing)
  • Loading branch information
pauby authored Dec 21, 2023
2 parents 455d26d + 59e2389 commit d692e67
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions automatic/nomacs/update.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import-module au

$releases = 'https://github.com/nomacs/nomacs/releases'
Import-Module AU

function global:au_SearchReplace {
@{
Expand All @@ -15,16 +13,16 @@ function global:au_SearchReplace {
}
}

function global:au_BeforeUpdate { Get-RemoteFiles -NoSuffix -Purge }
function global:au_BeforeUpdate { Get-RemoteFiles -NoSuffix -Purge }

function global:au_GetLatest {
$download_page = Invoke-WebRequest -Uri $releases -UseBasicParsing
$url = $download_page.links | ? href -like '*/nomacs-*x64.msi' | % href | select -First 1
$version = $url -split '\/' | select -Last 1 -Skip 1
$latestRelease = Get-GitHubRelease -Owner nomacs -Name nomacs
$url = $latestRelease.assets.Where{$_.name -like 'nomacs-*x64.msi'}[0].browser_download_url
$version = $latestRelease.tag_name.TrimStart('v')
@{
Version = $version
URL64 = "https://github.com/${url}"
ReleaseNotes = "https://github.com/nomacs/nomacs/releases/tag/${version}"
URL64 = $url
ReleaseNotes = $latestRelease.html_url
}
}

Expand Down

0 comments on commit d692e67

Please sign in to comment.