fix(env): remove misleading PATH position check in vp env doctor#1140
Conversation
✅ Deploy Preview for viteplus-preview canceled.
|
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep them coming! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Could you enable Allow edits from maintainers on this PR? We need to rebase it onto main. Also, please rebase your branch onto the latest main. Thanks! |
Replace the position-based PATH check with a simple presence check. The old code warned when `~/.vite-plus/bin` was not first in PATH, but on Windows putting bin first actually breaks `vp` due to the trampoline mechanism. The per-tool shim resolution check already provides meaningful diagnostics for shadowed shims.
6397862 to
f6f7962
Compare
@fengmk2 Thanks for merging! Just as a quick FYI, I couldn't enable the 'Allow edits' option earlier because I forked the repo to an organization account, which GitHub restricts. |
Summary
check_path()and replace with a simple presence checkvp env doctorwarned "For best results, bin should be first in PATH" when~/.vite-plus/binwas not at position 0 in PATH. On Windows, following this advice actually breaksvpcommands due to the trampoline mechanismChanges
paths.iter().position()→paths.iter().any()(index no longer needed)match3-arm (Some(0),Some(pos),None) →if/else(present/absent)Closes #1133