Update Build.ps1

Signed-off-by: Lev Rusanov <30170278+JDM170@users.noreply.github.com>
This commit is contained in:
2023-07-14 14:07:15 +07:00
parent a110a4b243
commit ad506f52ce

View File

@@ -18,6 +18,10 @@
# Requires -Version 5.1 # 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 # 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" # Download all files to "Script location folder\ReVanced"
$WorkingFolder = Split-Path $MyInvocation.MyCommand.Path -Parent $WorkingFolder = Split-Path $MyInvocation.MyCommand.Path -Parent
if (-not (Test-Path -Path "$WorkingFolder\ReVanced")) if (-not (Test-Path -Path "$WorkingFolder\ReVanced"))
@@ -145,6 +149,11 @@ $Parameters = @{
} }
Invoke-RestMethod @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 # https://github.com/ScoopInstaller/Java/blob/master/bucket/zulu-jdk.json
$Parameters = @{ $Parameters = @{
Uri = "https://raw.githubusercontent.com/ScoopInstaller/Java/master/bucket/zulu-jdk.json" Uri = "https://raw.githubusercontent.com/ScoopInstaller/Java/master/bucket/zulu-jdk.json"