Skip to content

feat(shim): add .cmd wrapper generation on Windows#235

Merged
CalvinAllen merged 1 commit intomainfrom
feat/shim/cmd-wrappers
Mar 4, 2026
Merged

feat(shim): add .cmd wrapper generation on Windows#235
CalvinAllen merged 1 commit intomainfrom
feat/shim/cmd-wrappers

Conversation

@CalvinAllen
Copy link
Contributor

Summary

  • On Windows, every .exe shim now gets a companion .cmd wrapper (@echo off + %~dp0<name>.exe %*) so tools that invoke runtime commands via .cmd (e.g., ASP.NET Core's SpaProxyLaunchManager calling npm.cmd) are properly intercepted by dtvem
  • RemoveShim cleans up .cmd wrappers alongside .exe shims
  • ListShims filters out .cmd/.bat files to prevent duplicate entries

Closes #234

Test plan

  • All existing tests pass (go test ./... — 160+ tests)
  • 3 new Windows-specific tests added and passing
  • Linter passes (golangci-lint run ./... — 0 issues)
  • Manual verification: run dtvem reshim on Windows, confirm .cmd files appear in ~/.dtvem/shims/
  • Manual verification: npm.cmd in shims dir correctly forwards to npm.exe shim

On Windows, create a companion .cmd file for every .exe shim so that
tools invoking runtime commands via .cmd (e.g., ASP.NET Core's
SpaProxyLaunchManager calling npm.cmd) are properly intercepted.

- CreateShim now writes a .cmd wrapper alongside the .exe shim
- RemoveShim now removes the .cmd wrapper alongside the .exe shim
- ListShims now skips .cmd/.bat files to avoid duplicate entries
- Add ExtCmd constant to constants package
@CalvinAllen CalvinAllen merged commit bd9b37f into main Mar 4, 2026
12 checks passed
@CalvinAllen CalvinAllen deleted the feat/shim/cmd-wrappers branch March 4, 2026 21:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Windows node.js needs extra shim for npm.cmd

1 participant