Skip to content

Commit

Permalink
Update update.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
chtof committed Nov 11, 2021
1 parent 33da5e8 commit 24b9bd1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions automatic/sublimemerge/update.ps1
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
import-module au

function global:au_GetLatest {
$releases = 'https://www.sublimemerge.com/download'
$releases = 'https://www.sublimemerge.com/download_thanks?target=win-x64'
$regex = "https://download.sublimetext.com/sublime_merge_build_(?<Version>[\d]+)_x64_setup.exe"

$download_page = Invoke-WebRequest -Uri $releases -UseBasicParsing
$url = $download_page.links | ? href -match $regex | select -Last 1

return @{
Version = "0.0." + $matches.Version
URL32 = $url.href
URL64 = $url.href
}
}

function global:au_SearchReplace {
@{
"tools\chocolateyinstall.ps1" = @{
"(^(\s)*url\s*=\s*)('.*')" = "`$1'$($Latest.URL32)'"
"(^(\s)*checksum\s*=\s*)('.*')" = "`$1'$($Latest.Checksum32)'"
"(^(\s)*url64\s*=\s*)('.*')" = "`$1'$($Latest.URL32)'"
"(^(\s)*checksum64\s*=\s*)('.*')" = "`$1'$($Latest.Checksum32)'"
}
}
}

update
update -ChecksumFor 64

0 comments on commit 24b9bd1

Please sign in to comment.