Skip to content

Commit

Permalink
add Fork.Fork
Browse files Browse the repository at this point in the history
  • Loading branch information
a-mnich committed May 11, 2024
1 parent 8449ca1 commit 9773e27
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/update-via-script.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ jobs:
With: WinGetCreate
- PackageName: "SmartProjects.IsoBuster"
WebsiteURL: "https://www.isobuster.com/downloads/isobuster/isobuster_install_64bit.exe https://www.isobuster.com/downloads/isobuster/isobuster_install.exe"
- PackageName: "Fork.Fork"
WebsiteURL: "https://fork.dev"

steps:
- name: Checkout
Expand Down
23 changes: 23 additions & 0 deletions Scripts/Update-Fork.Fork.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
. .\Scripts\common.ps1


# Currently not all versions have .exe installers
#Text response with entries of form "<SHA> Fork-<Version>-<FUll|Delta>.nupkg <SIZE>"
# Invoke-WebRequest -Uri "https://git-fork.com/update/win/RELEASES?id=Fork" -OutFile "RELEASES"
# $releases = Get-Content "RELEASES"
# $versionNumbers = $releases | ForEach-Object {
# if ($_ -match 'Fork-(.*?)-') {
# $Matches[1]
# }
# }
# $versionNumbers = $versionNumbers | Sort-Object -Descending | Select-Object -Unique

# $latestVersion = $versionNumbers[0]
# $latestVersionUrl = "https://cdn.fork.dev/win/Fork-$latestVersion.exe"

$websiteContent = Invoke-WebRequest -Uri $WebsiteURL
$latestVersionUrl = $websiteContent.Links | Where-Object {$_.tagName -eq "A" -and $_.outerHTML.Contains('"downloadBtn2Win"')} | Select-Object -First 1 -ExpandProperty href
# extract version from link
$latestVersion = [regex]::Match($latestVersionUrl, '.*Fork-(.*).exe').Groups[1].Value

return $latestVersion, "$latestVersionUrl"

0 comments on commit 9773e27

Please sign in to comment.