Skip to content

Commit 9bb6459

Browse files
committed
fix(shim): Restore original path for JAR cmd (#6030)
1 parent 1b6b9e9 commit 9bb6459

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
- **core:** Use correct path in 'bash' ([#6006](https://github.com/ScoopInstaller/Scoop/issues/6006))
2020
- **core:** Limit the number of commands to get when search for git executable ([#6013](https://github.com/ScoopInstaller/Scoop/pull/6013))
2121
- **checkver:** Correct error messages ([#6024](https://github.com/ScoopInstaller/Scoop/issues/6024))
22+
- **shim:** Restore original path for JAR cmd ([#6030](https://github.com/ScoopInstaller/Scoop/issues/6030))
2223

2324
### Code Refactoring
2425

lib/core.ps1

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,8 +1038,9 @@ function shim($path, $global, $name, $arg) {
10381038
warn_on_overwrite "$shim.cmd" $path
10391039
@(
10401040
"@rem $resolved_path",
1041-
"@cd /d $(Split-Path $resolved_path -Parent)"
1042-
"@java -jar `"$resolved_path`" $arg %*"
1041+
"@pushd $(Split-Path $resolved_path -Parent)",
1042+
"@java -jar `"$resolved_path`" $arg %*",
1043+
"@popd"
10431044
) -join "`r`n" | Out-UTF8File "$shim.cmd"
10441045

10451046
warn_on_overwrite $shim $path

0 commit comments

Comments
 (0)