chicken-package/update.ps1

16 lines
511 B
PowerShell
Raw Normal View History

2020-03-01 18:46:53 +00:00
function global:au_GetLatest {
$download_page = Invoke-WebRequest -UseBasicParsing -Uri 'http://code.call-cc.org/'
$url = $download_page.links | ? href -Match '.tar\.gz$' | select -First 1 -Expand href
$version = $url -Split '-|.tar.gz' | select -Last 1 -Skip 1
return @{ Version = $version; URL = $url }
}
function global:au_SearchReplace {
@{
"build.ps1" = @{
"(^[$]version\s*=\s*)('.*')" = "`$1'$($Latest.Version)'"
}
}
}
Update-Package