From f18c24ea5bd4d71d2c4c95e31125ac941117f6a1 Mon Sep 17 00:00:00 2001 From: zerone0x Date: Mon, 16 Mar 2026 21:53:56 +0800 Subject: [PATCH] fix(env): check all shell profiles in `vp env doctor` `check_profile_files` only checked `.zshenv` + `.profile` on macOS and `.profile` on Linux, but the install script writes to `.zshenv`, `.zshrc`, `.bash_profile`, `.bashrc`, and `.profile`. This caused doctor to report missing IDE integration even when everything was correctly configured. Unify the profile list to match install.sh and implode.rs. Closes #881 Co-Authored-By: Claude Opus 4.6 --- crates/vite_global_cli/src/commands/env/doctor.rs | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/crates/vite_global_cli/src/commands/env/doctor.rs b/crates/vite_global_cli/src/commands/env/doctor.rs index c1ace3df55..6cfb4c0330 100644 --- a/crates/vite_global_cli/src/commands/env/doctor.rs +++ b/crates/vite_global_cli/src/commands/env/doctor.rs @@ -457,15 +457,9 @@ fn check_profile_files(vite_plus_home: &str) -> Option { search_strings.push(format!("{home_dir}{suffix}{env_suffix}")); } - #[cfg(target_os = "macos")] - let profile_files: &[&str] = &[".zshenv", ".profile"]; - - #[cfg(target_os = "linux")] - let profile_files: &[&str] = &[".profile"]; - - // Fallback for other Unix platforms - #[cfg(not(any(target_os = "macos", target_os = "linux")))] - let profile_files: &[&str] = &[".profile"]; + // Check all profile files the install script may write to. + // This matches install.sh and implode.rs for consistency. + let profile_files: &[&str] = &[".zshenv", ".zshrc", ".bash_profile", ".bashrc", ".profile"]; for file in profile_files { let full_path = format!("{home_dir}/{file}");