From ad506f52cea598f37bd435954ad29b5b6d62289d Mon Sep 17 00:00:00 2001 From: Lev Rusanov <30170278+JDM170@users.noreply.github.com> Date: Fri, 14 Jul 2023 14:07:15 +0700 Subject: [PATCH] Update Build.ps1 Signed-off-by: Lev Rusanov <30170278+JDM170@users.noreply.github.com> --- Build.ps1 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Build.ps1 b/Build.ps1 index 3e22ebb..fa3de21 100644 --- a/Build.ps1 +++ b/Build.ps1 @@ -18,6 +18,10 @@ # Requires -Version 5.1 # Doesn't work on PowerShell 7.2 due it doesn't contains IE parser engine. You have to use a 3rd party module to make it work like it's presented in CI/CD config: AngleSharp +# Invoke-Webrequest speedup workaround. Improved downloads speeds significantly. +# Ref: https://www.codewrecks.com/post/azdo/pills/powershell-download/ +$ProgressPreference = 'SilentlyContinue' + # Download all files to "Script location folder\ReVanced" $WorkingFolder = Split-Path $MyInvocation.MyCommand.Path -Parent if (-not (Test-Path -Path "$WorkingFolder\ReVanced")) @@ -145,6 +149,11 @@ $Parameters = @{ } Invoke-RestMethod @Parameters +# Sometimes older version of zulu-jdk causes conflict, so remove older version before proceeding. +if (Test-Path -Path "$WorkingFolder\ReVanced\jdk") { + Remove-Item -Path "$WorkingFolder\ReVanced\jdk" -Recurse -Force +} + # https://github.com/ScoopInstaller/Java/blob/master/bucket/zulu-jdk.json $Parameters = @{ Uri = "https://raw.githubusercontent.com/ScoopInstaller/Java/master/bucket/zulu-jdk.json"