Skip to content

Commit

Permalink
Merge pull request #2305 from JPRuskin/fix-nomacs.portable
Browse files Browse the repository at this point in the history
(nomacs.portable) Fixes Update.ps1 (HTML Parsing)
  • Loading branch information
pauby authored Dec 21, 2023
2 parents d692e67 + 28930e9 commit bdbf322
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions automatic/nomacs.portable/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 @@ -23,14 +21,14 @@ function global:au_SearchReplace {
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-*.zip' | % 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-*.zip'}[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}"
FileName = $url -split '/' | select -last 1
URL64 = $url
ReleaseNotes = $latestRelease.html_url
FileName = $url -split '/' | Select-Object -last 1
}
}

Expand Down

0 comments on commit bdbf322

Please sign in to comment.