Skip to content

Commit

Permalink
fix(shim): Restore original path for JAR cmd (#6030)
Browse files Browse the repository at this point in the history
  • Loading branch information
niheaven authored Jun 26, 2024
1 parent d8b3cc8 commit 93359a4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
- **core:** Use correct path in 'bash' ([#6006](https://github.com/ScoopInstaller/Scoop/issues/6006))
- **core:** Limit the number of commands to get when search for git executable ([#6013](https://github.com/ScoopInstaller/Scoop/pull/6013))
- **checkver:** Correct error messages ([#6024](https://github.com/ScoopInstaller/Scoop/issues/6024))
- **shim:** Restore original path for JAR cmd ([#6030](https://github.com/ScoopInstaller/Scoop/issues/6030))

### Code Refactoring

Expand Down
5 changes: 3 additions & 2 deletions lib/core.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -1038,8 +1038,9 @@ function shim($path, $global, $name, $arg) {
warn_on_overwrite "$shim.cmd" $path
@(
"@rem $resolved_path",
"@cd /d $(Split-Path $resolved_path -Parent)"
"@java -jar `"$resolved_path`" $arg %*"
"@pushd $(Split-Path $resolved_path -Parent)",
"@java -jar `"$resolved_path`" $arg %*",
"@popd"
) -join "`r`n" | Out-UTF8File "$shim.cmd"

warn_on_overwrite $shim $path
Expand Down

0 comments on commit 93359a4

Please sign in to comment.