Skip to content

Commit

Permalink
Fixed ps1/jar->ps1 shims args handling. (ScoopInstaller#2120)
Browse files Browse the repository at this point in the history
  • Loading branch information
excitoon authored and r15ch13 committed May 4, 2018
1 parent 563a173 commit 6236750
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions lib/core.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -270,14 +270,10 @@ function shim($path, $global, $name, $arg) {
write-output "`$path = join-path `"`$psscriptroot`" `"$relative_path`"" | out-file "$shim.ps1" -encoding utf8
}

if($arg) {
write-output "`$args = '$($arg -join "', '")', `$args" | out-file "$shim.ps1" -encoding utf8 -append
}

if($path -match '\.jar$') {
"if(`$myinvocation.expectingInput) { `$input | & java -jar `$path @args } else { & java -jar `$path @args }" | out-file "$shim.ps1" -encoding utf8 -append
"if(`$myinvocation.expectingInput) { `$input | & java -jar `$path $arg @args } else { & java -jar `$path $arg @args }" | out-file "$shim.ps1" -encoding utf8 -append
} else {
"if(`$myinvocation.expectingInput) { `$input | & `$path @args } else { & `$path @args }" | out-file "$shim.ps1" -encoding utf8 -append
"if(`$myinvocation.expectingInput) { `$input | & `$path $arg @args } else { & `$path $arg @args }" | out-file "$shim.ps1" -encoding utf8 -append
}

if($path -match '\.exe$') {
Expand Down

0 comments on commit 6236750

Please sign in to comment.