Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
### Bug Fixes

- **decompress**: `Expand-7zipArchive` only delete temp dir / `$extractDir` if it is empty ([#6092](https://github.com/ScoopInstaller/Scoop/issues/6092))
- **shim:** Do not suppress `stderr`, properly check `wslpath`/`cygpath` command first ([#6114](https://github.com/ScoopInstaller/Scoop/pull/6114))

### Code Refactoring

Expand Down
11 changes: 8 additions & 3 deletions lib/core.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -1005,9 +1005,14 @@ function shim($path, $global, $name, $arg) {
warn_on_overwrite "$shim.cmd" $path
@(
"@rem $resolved_path",
"@bash `"`$(wslpath -u '$resolved_path')`" $arg %* 2>nul",
'@if %errorlevel% neq 0 (',
" @bash `"`$(cygpath -u '$resolved_path')`" $arg %* 2>nul",
'@bash -c "command -v wslpath >/dev/null 2>&1"',
'@if %errorlevel% equ 0 (',
" @bash `"`$(wslpath -u '$resolved_path')`" $arg %*",
') else (',
' @bash -c "command -v cygpath >/dev/null 2>&1"',
' @if %errorlevel% equ 0 (',
" @bash `"`$(cygpath -u '$resolved_path')`" $arg %*",
' )',
Comment thread
sitiom marked this conversation as resolved.
Outdated
')'
) -join "`r`n" | Out-UTF8File "$shim.cmd"

Expand Down