Skip to content

Commit 6236750

Browse files
excitoonr15ch13
authored andcommitted
Fixed ps1/jar->ps1 shims args handling. (#2120)
1 parent 563a173 commit 6236750

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

lib/core.ps1

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -270,14 +270,10 @@ function shim($path, $global, $name, $arg) {
270270
write-output "`$path = join-path `"`$psscriptroot`" `"$relative_path`"" | out-file "$shim.ps1" -encoding utf8
271271
}
272272

273-
if($arg) {
274-
write-output "`$args = '$($arg -join "', '")', `$args" | out-file "$shim.ps1" -encoding utf8 -append
275-
}
276-
277273
if($path -match '\.jar$') {
278-
"if(`$myinvocation.expectingInput) { `$input | & java -jar `$path @args } else { & java -jar `$path @args }" | out-file "$shim.ps1" -encoding utf8 -append
274+
"if(`$myinvocation.expectingInput) { `$input | & java -jar `$path $arg @args } else { & java -jar `$path $arg @args }" | out-file "$shim.ps1" -encoding utf8 -append
279275
} else {
280-
"if(`$myinvocation.expectingInput) { `$input | & `$path @args } else { & `$path @args }" | out-file "$shim.ps1" -encoding utf8 -append
276+
"if(`$myinvocation.expectingInput) { `$input | & `$path $arg @args } else { & `$path $arg @args }" | out-file "$shim.ps1" -encoding utf8 -append
281277
}
282278

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

0 commit comments

Comments
 (0)