diff --git a/revanced.ps1 b/revanced.ps1 index ad2f51f..990819b 100644 --- a/revanced.ps1 +++ b/revanced.ps1 @@ -8,7 +8,15 @@ Add-type -AssemblyName System.Drawing $ProgressPreference = 'SilentlyContinue' $ErrorActionPreference = 'Stop' + function execJava { +<# +.Description +execJava was created to additionally allow providing an array of strings to java arguments +if the first argument is a string array, it will launch with arguments in that array +otherwise it will launch with all provided arguments +#> + $SavedErrorActionPreference = $ErrorActionPreference $ErrorActionPreference = 'Continue' if ($args[0].getType().Name -ne "String") { & $Java $args[0] 2>&1 | ForEach-Object{ "$_" } @@ -16,7 +24,7 @@ function execJava { else { & $Java $args 2>&1 | ForEach-Object{ "$_" } } - $ErrorActionPreference = 'Stop' + $ErrorActionPreference = $SavedErrorActionPreference } function renderForm([String[]]$items, [String]$label, [String]$title, [System.Windows.Forms.SelectionMode]$mode, [System.Collections.ArrayList]$selected) { @@ -121,6 +129,8 @@ function main { New-Item -type Directory -Path ".\app" -ErrorAction SilentlyContinue | Out-Null + # TODO: use where-object to search for filename + if ($install[0]) { Write-Output "Downloading Patches ($($config.patches) -> $($patchesRelease.tag_name))" Write-Output "changelog: https://github.com/revanced/revanced-patches/compare/$($config.patches)...$($patchesRelease.tag_name)"