Skip to content

fix(cli): make env shims use the active vp executable#1631

Open
leohara wants to merge 1 commit into
voidzero-dev:mainfrom
leohara:fix/homebrew-env-shims
Open

fix(cli): make env shims use the active vp executable#1631
leohara wants to merge 1 commit into
voidzero-dev:mainfrom
leohara:fix/homebrew-env-shims

Conversation

@leohara
Copy link
Copy Markdown

@leohara leohara commented May 19, 2026

Summary

Fix Unix env shims created by vp env setup so they point to the active vp executable instead of always assuming the standalone VP_HOME/current/bin/vp layout.

This keeps the existing standalone behavior when the active executable is VP_HOME/current/bin/vp, while making Homebrew-style installs work when vp lives outside VP_HOME.

Fixes #1572 .

Details

  • Resolve the Unix shim target from the currently running vp
  • Preserve ../current/bin/vp for standalone installs
  • Recreate stale or broken Unix core shim symlinks without requiring --refresh.
  • Add a global snap test that simulates an external/Homebrew-style vp and verifies:
    • shims point to the external vp
    • command -v node resolves to the Vite+ shim
    • node -v uses the project Node version

Note

This PR intentionally keeps the scope focused on vp env setup core shims. I noticed that package binary shims created by vp install -g also use the ../current/bin/vp Unix target today, but I left that out to keep this PR focused on the reported Homebrew node shim issue. If you’d prefer fixing those package shims in the same PR, I’m happy to add that follow-up change here.

Verification

  • cargo test -p vite_global_cli shim -- --nocapture
  • pnpm bootstrap-cli
  • pnpm -C packages/cli snap-test-global command-env-setup-external-vp
  • vp check --fix
  • cargo clippy -p vite_global_cli --all-targets
  • cargo fmt --check
  • git diff --check

@netlify
Copy link
Copy Markdown

netlify Bot commented May 19, 2026

Deploy Preview for viteplus-preview canceled.

Name Link
🔨 Latest commit f4b525c
🔍 Latest deploy log https://app.netlify.com/projects/viteplus-preview/deploys/6a0c664311e7de0008fbc004

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Homebrew installation breaks vp env due to bundled Node.js dependency

1 participant