diff --git a/CHANGELOG.md b/CHANGELOG.md index d9a56e46ad..9291034349 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ - **commands**: Handling broken aliases ([#6141](https://github.com/ScoopInstaller/Scoop/issues/6141)) - **shim:** Do not suppress `stderr`, properly check `wslpath`/`cygpath` command first ([#6114](https://github.com/ScoopInstaller/Scoop/issues/6114)) - **scoop-bucket:** Add missing import for `no_junction` envs ([#6181](https://github.com/ScoopInstaller/Scoop/issues/6181)) +- **shim:** Run JAR file directly ([#6203](https://github.com/ScoopInstaller/Scoop/issues/6203)) ### Code Refactoring diff --git a/lib/core.ps1 b/lib/core.ps1 index c271ce8f94..2d01b92c68 100644 --- a/lib/core.ps1 +++ b/lib/core.ps1 @@ -971,21 +971,13 @@ function shim($path, $global, $name, $arg) { warn_on_overwrite "$shim.cmd" $path @( "@rem $resolved_path", - "@pushd $(Split-Path $resolved_path -Parent)", - "@java -jar `"$resolved_path`" $arg %*", - "@popd" + "@java -jar `"$resolved_path`" $arg %*" ) -join "`r`n" | Out-UTF8File "$shim.cmd" warn_on_overwrite $shim $path @( "#!/bin/sh", "# $resolved_path", - "if [ `$WSL_INTEROP ]", - 'then', - " cd `$(wslpath -u '$(Split-Path $resolved_path -Parent)')", - 'else', - " cd `$(cygpath -u '$(Split-Path $resolved_path -Parent)')", - 'fi', "java.exe -jar `"$resolved_path`" $arg `"$@`"" ) -join "`n" | Out-UTF8File $shim -NoNewLine } elseif ($path -match '\.py$') {