Skip to content

Commit

Permalink
Merge pull request #2034 from TheCakeIsNaOH/notepadplusplus-ghfix
Browse files Browse the repository at this point in the history
Fixes #2000
  • Loading branch information
Alex Lopez authored Nov 17, 2022
2 parents 8e3da62 + fe5babd commit 641c69d
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions automatic/notepadplusplus/update.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,14 @@ function global:au_SearchReplace {
}

function global:au_GetLatest {
$tags = "https://github.com/notepad-plus-plus/notepad-plus-plus/tags"
$release = Invoke-WebRequest $tags -UseBasicParsing
$new = (( $release.links -match "\/v\d+\.\d+(\.\d+)?" ) -split " " | select -First 10 | Select -Last 1 )
$new = $new.Substring(1,$new.Length-2)
$https = "https://github.com"
$releases = "https://github.com/notepad-plus-plus/notepad-plus-plus/releases/tag/v$new/"
$download_page = Invoke-WebRequest $releases -UseBasicParsing
$url_i = $download_page.Links | ? href -match '.exe$' | Select-Object -Last 2 | % { $https + $_.href }
$url_p = $download_page.Links | ? href -match '.7z$' | % { $https + $_.href }
$LatestRelease = Get-GitHubRelease -Owner "notepad-plus-plus" -Name "notepad-plus-plus"

@{
Version = Get-Version ( $url_i -notmatch 'x64' | select -First 1 )
URL32_i = $url_i -notmatch 'x64' | select -First 1
URL64_i = $url_i -match 'x64' | select -First 1
URL32_p = $url_p -notmatch 'x64' -notmatch 'minimalist' | select -First 1
URL64_p = $url_p -match 'x64' -notmatch 'minimalist' | select -First 1
Version = $LatestRelease.tag_name.Trim("v")
URL32_i = $LatestRelease.assets | Where-Object {$_.name.EndsWith("Installer.exe")} | Select-Object -ExpandProperty browser_download_url
URL64_i = $LatestRelease.assets | Where-Object {$_.name.EndsWith("x64.exe")} | Select-Object -ExpandProperty browser_download_url
URL32_p = $LatestRelease.assets | Where-Object {$_.name.EndsWith("portable.7z")} | Select-Object -ExpandProperty browser_download_url
URL64_p = $LatestRelease.assets | Where-Object {$_.name.EndsWith("portable.x64.7z")} | Select-Object -ExpandProperty browser_download_url
}
}

Expand Down

0 comments on commit 641c69d

Please sign in to comment.