Commit 194225e
authored
fix(env): remove misleading PATH position check in
## Summary
- Remove PATH position-based check in `check_path()` and replace with a
simple presence check
- Previously, `vp env doctor` warned "For best results, bin should be
first in PATH" when `~/.vite-plus/bin` was not at position 0 in PATH. On
Windows, following this advice actually breaks `vp` commands due to the
trampoline mechanism
## Changes
- `paths.iter().position()` → `paths.iter().any()` (index no longer
needed)
- `match` 3-arm (`Some(0)`, `Some(pos)`, `None`) → `if/else`
(present/absent)
Closes #1133vp env doctor (#1140)1 parent b4e091c commit 194225e
1 file changed
+9
-20
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
408 | 408 | | |
409 | 409 | | |
410 | 410 | | |
411 | | - | |
| 411 | + | |
412 | 412 | | |
413 | 413 | | |
414 | 414 | | |
415 | | - | |
416 | | - | |
417 | | - | |
418 | | - | |
419 | | - | |
420 | | - | |
421 | | - | |
422 | | - | |
423 | | - | |
424 | | - | |
425 | | - | |
426 | | - | |
427 | | - | |
428 | | - | |
429 | | - | |
430 | | - | |
431 | | - | |
432 | | - | |
433 | | - | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
434 | 423 | | |
435 | 424 | | |
436 | 425 | | |
| |||
0 commit comments