You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(env): clarify the use case of vp-use.cmd (#2128)
`vp env setup` currently creates `vp-use.cmd` on every platform even
though the wrapper is only usable from Windows Command Prompt. Its
writer also runs before `VP_HOME/bin` is created, so setup skips the
wrapper when starting from a fresh home. The CMD-specific
version-switching command is also missing from the public environment
guide.
This PR creates `vp-use.cmd` alongside the Windows shims after the bin
directory is initialized, adds regression coverage for fresh Windows
setup and Unix exclusion, and documents how to use `vp-use` from Command
Prompt.
🤖 Generated with Codex
Copy file name to clipboardExpand all lines: docs/guide/env.md
+10Lines changed: 10 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -64,6 +64,16 @@ Open the profile file for editing:
64
64
Invoke-Item $PROFILE
65
65
```
66
66
67
+
Windows Command Prompt (`cmd.exe`) cannot define the wrapper function needed for `vp env use` to update the current shell session. Use the generated `vp-use.cmd` command instead:
68
+
69
+
```batch
70
+
vp-use 20
71
+
node --version
72
+
vp-use --unset
73
+
```
74
+
75
+
Only `vp env use` needs this alternate command. Other `vp env` commands work normally in Command Prompt. `vp env setup` creates `vp-use.cmd` under `VP_HOME/bin` on Windows.
76
+
67
77
In CI, `vp env use` can still run without shell initialization. It writes a temporary session file under `VP_HOME` so later shim calls in the same job can resolve the selected Node.js version.
0 commit comments