-
Notifications
You must be signed in to change notification settings - Fork 0
Labels
bugSomething isn't workingSomething isn't working
Description
Description
On Windows, when a shimmed command (like npm) exits with a non-zero exit code, the dtvem shim incorrectly reports a failure error even though the command ran successfully.
Steps to Reproduce
- Run
npm --versionornpm configvia the dtvem shim on Windows - Observe the error message after the command output
Expected Behavior
The shim should silently propagate the exit code from the underlying command without printing an error message.
Actual Behavior
npm@10.5.1 C:\Users\user\.dtvem\versions\node\22.0.0\node_modules\npm
dtvem shim error: failed to execute C:\Users\user\.dtvem\versions\node\22.0.0\npm.cmd: exit status 1
Root Cause
On Windows, syscall.Exec is not supported, so the shim falls back to cmd.Run(). When the wrapped command exits with a non-zero code, cmd.Run() returns an *exec.ExitError, which the shim was treating as a failure rather than a normal exit with a specific code.
Solution
Detect *exec.ExitError and call os.Exit() with the command's exit code instead of returning an error.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working