Repository navigation
fix(shell): nushell uninstall cleans all candidate locations, dedup candidates - #1050
Conversation
…andidates Follow-up fixes to #1038 where config_paths() was changed to return multiple Nushell candidates but not all consumers were updated: - Uninstall now iterates all candidate paths instead of only the first, so config files installed at a different location (e.g., nu was in PATH during install but not during uninstall) get cleaned up - has_config_location checks any candidate's parent directory for auto-detection, not just the first - Removed redundant etcetera entry from nushell_config_candidates() (always duplicated either $XDG_CONFIG_HOME/nushell or ~/.config/nushell) and added HashSet-based dedup for remaining edge cases Co-Authored-By: Claude <[email protected]>
Deduplicate 4 identical remove_file + map_err + format! patterns into a shared remove_config_file() helper. Improves patch coverage by making the nushell uninstall block a simple function call. Co-Authored-By: Claude <[email protected]>
|
Clean, well-motivated fix. The core bug was real — Nushell uninstall only checked A few observations: Design notes (3 items)Nushell doesn't check
Dedup of Test observationsThe new integration test The The updated Looks good to merge once CI is green. |
Summary
Follow-up fixes to #1038 where
config_paths()was changed to return multiple Nushell candidates but not all consumers were updated:paths.first(), so config files installed at a different location (e.g.,nuwas in PATH during install but not during uninstall) get cleaned uphas_config_locationchecks any candidate's parent directory for auto-detection, not just the firstnushell_config_candidates()— removed redundant etcetera entry (always duplicated either$XDG_CONFIG_HOME/nushellor~/.config/nushell) and addedHashSet-based dedup for remaining edge casesTest plan
test_uninstall_nushell_cleans_all_candidate_locations— installs at default location, copies to secondary candidate, uninstalls with differentXDG_CONFIG_HOME, verifies both files removedtest_nushell_config_candidates_no_duplicates— verifies no duplicate pathstest_nushell_config_candidates_always_has_fallback— platform-aware assertions