document execJava
This commit is contained in:
parent
7f8d160661
commit
96c6ba3d3c
1 changed files with 11 additions and 1 deletions
12
revanced.ps1
12
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)"
|
||||
|
|
Reference in a new issue