From 75bff432321323644167dd1c0b93fbc875656563 Mon Sep 17 00:00:00 2001 From: Wroclaw Date: Mon, 4 Jul 2022 22:41:42 +0200 Subject: [PATCH] Add changelog link --- revanced.ps1 | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/revanced.ps1 b/revanced.ps1 index 82af8c7..b1e7228 100644 --- a/revanced.ps1 +++ b/revanced.ps1 @@ -116,12 +116,6 @@ function main { $integrationsRelease = ConvertFrom-Json (Invoke-WebRequest https://api.github.com/repos/revanced/revanced-integrations/releases/latest).Content $cliRelease = ConvertFrom-Json (Invoke-WebRequest https://api.github.com/repos/revanced/revanced-cli/releases/latest).Content - $gitHubVersions = [PSCustomObject]@{ - patches = $patchesRelease.tag_name - integrations = $integrationsRelease.tag_name - cli = $cliRelease.tag_name - } - # Check versions [Bool[]]$install = $true, $true, $true @@ -129,9 +123,9 @@ function main { try { $config.load(".\config.json") - if ($config.patches -eq $githubVersions.patches) {$install[0] = $false} - if ($config.integrations -eq $gitHubVersions.integrations) {$install[1] = $false} - if ($config.cli -eq $gitHubVersions.cli) {$install[2] = $false} + if ($config.patches -eq $patchesRelease.tag_name) {$install[0] = $false} + if ($config.integrations -eq $integrationsRelease.tag_name) {$install[1] = $false} + if ($config.cli -eq $cliRelease.tag_name) {$install[2] = $false} } catch [System.Management.Automation.ItemNotFoundException] { Write-Output "currentVersion.json not found, downloading everything" @@ -142,21 +136,21 @@ function main { New-Item -type Directory -Path ".\app" -ErrorAction SilentlyContinue | Out-Null if ($install[0]) { - Write-Output "Downloading Patches ($($config.patches) -> $($gitHubVersions.patches))" + Write-Output "Downloading Patches ($($config.patches) -> $($patchesRelease.tag_name)) changelog: $($patchesRelease.html_url)" Invoke-WebRequest $patchesRelease.assets[1].browser_download_url -OutFile ".\app\revanced-patches.jar" - $config.patches = $gitHubVersions.patches + $config.patches = $patchesRelease.tag_name } else {Write-Output "Patches up to date $($config.patches)"} if ($install[1]) { - Write-Output "Downloading Integrations ($($config.integrations) -> $($gitHubVersions.integrations))" + Write-Output "Downloading Integrations ($($config.integrations) -> $($integrationsRelease.tag_name)) changelog: $($integrationsRelease.html_url)" Invoke-WebRequest $integrationsRelease.assets[0].browser_download_url -OutFile ".\app\app-release-unsigned.apk" - $config.integrations = $gitHubVersions.integrations + $config.integrations = $integrationsRelease.tag_name } else {Write-Output "Integrations up to date $($config.integrations)"} if ($install[2]) { - Write-Output "Downloading cli ($($config.cli) -> $($gitHubVersions.cli))" + Write-Output "Downloading cli ($($config.cli) -> $($cliRelease.tag_name)) changelog: $($cliRelease.html_url)" Invoke-WebRequest $cliRelease.assets[0].browser_download_url -OutFile ".\app\revanced-cli.jar" - $config.cli = $gitHubVersions.cli + $config.cli = $cliRelease.tag_name } else {Write-Output "cli up to date! $($config.cli)"}