[Bug] stderr output suppressed on shell script shim
Bug Report
The .cmd shim created by Scoop has a 2>nul redirect at the end which suppresses stderr output, breaking behavior on most scripts (https://github.com/ScoopInstaller/Main/pull/6090#pullrequestreview-2231325689, https://github.com/ScoopInstaller/Main/pull/6117#pullrequestreview-2244891697). Example shim from neofetch:
Example command for reproduction: neofetch -v
Current Behavior
Error messages are not shown (called from the .cmd shim on PowerShell)
Expected Behavior
Error messages should be shown (Example from bash)
Additional context/output
It used to be working before, and the regression was introduced in https://github.com/ScoopInstaller/Scoop/commit/a9ca75c0cda0ab9f2b683f972dc4a2c65d1b1cd0.
Possible Solution
Perhaps a proper check of the wslpath and cygpath command first should work:
@rem C:\Users\rycae\scoop\apps\wcurl\current\wcurl
@echo off
bash -c "command -v wslpath >/dev/null"
if %errorlevel% equ 0 (
bash "$(wslpath -u 'C:\Users\rycae\scoop\apps\wcurl\current\wcurl')" %*
) else (
set args= %*
setlocal enabledelayedexpansion
if not "!args!"=="" set args=!args:"=""!
bash -c "$(cygpath -u 'C:\Users\rycae\scoop\apps\wcurl\current\wcurl') !args!"
)
System details
Windows version: 11
OS architecture: 32bit, 64bit
PowerShell version: 7.4.4
Additional software: WSL, Git
Scoop Configuration
{
"aria2-warning-enabled": false,
"last_update": "2024-08-19T15:35:17.7825723+08:00",
"scoop_branch": "master",
"scoop_repo": "https://github.com/ScoopInstaller/Scoop"
}
Any updates on this?