fix(cli): respect ZDOTDIR and XDG_CONFIG_HOME in install, doctor, and implode#892
fix(cli): respect ZDOTDIR and XDG_CONFIG_HOME in install, doctor, and implode#892mst-mkt wants to merge 10 commits intovoidzero-dev:mainfrom
ZDOTDIR and XDG_CONFIG_HOME in install, doctor, and implode#892Conversation
✅ Deploy Preview for viteplus-preview canceled.
|
|
Tested on deploy preview with |
|
Nice work! The install.sh and implode.rs changes look good. One issue I noticed in The new Suggested fix — add a default fish config check before the new ZDOTDIR/XDG blocks (around line 477): // Also check the default fish conf.d location
let fish_path = format!("{home_dir}/.config/fish/conf.d/vite-plus.fish");
if let Ok(content) = std::fs::read_to_string(&fish_path) {
if search_strings.iter().any(|s| content.contains(s)) {
return Some(abbreviate_home(&fish_path));
}
}This way doctor detects fish configs regardless of whether |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
packages/cli/install.sh
Outdated
| fi | ||
| echo "" | ||
| echo " Note: Run \`source ~/$SHELL_CONFIG_UPDATED\` or restart your terminal." | ||
| echo " Note: Run \`source $display_config\` or restart your terminal." |
| std::fs::write(fish_dir.join("vite-plus.fish"), "source \"$HOME/.vite-plus/env\"\n") | ||
| .unwrap(); |
|
|
||
| #[test] | ||
| #[serial] | ||
| fn test_collect_affected_profiles() { |
There was a problem hiding this comment.
should ignore these tests on Windows too.
Co-Authored-By: Copilot <175728472+Copilot@users.noreply.github.com>
Co-Authored-By: Copilot <175728472+Copilot@users.noreply.github.com>
Co-Authored-By: Copilot <175728472+Copilot@users.noreply.github.com>
issue
resolves #890
details
install.shhardcodes$HOMEfor shell config paths, ignoringZDOTDIR(zsh) andXDG_CONFIG_HOME(fish). This PR respects these variables across install, doctor, and implode.changes
install.shUse
${ZDOTDIR:-$HOME}for zsh and${XDG_CONFIG_HOME:-$HOME/.config}for fish.SHELL_CONFIG_UPDATEDis now an absolute path, and thesourcehint displays~/...or the absolute path accordingly.doctor.rsAlso check
$ZDOTDIRand$XDG_CONFIG_HOMElocations when detecting profile configuration.implode.rsAlso collect and clean profiles from these custom locations during uninstall.