Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes post-uninstall PowerShell startup errors (
Import-Module ... nvm.psm1not found) and the root cause behind them.Bug 1 — uninstall only cleaned ONE PowerShell profile:
install/repair code historically wrote to both the PowerShell 7 (
Documents\PowerShell) and Windows PowerShell 5.1 (Documents\WindowsPowerShell) profiles, butremove_from_shell_configonly cleaned the onedetect_shell_configprefers. The other kept a staleImport-Module, erroring on every shell start after uninstall.nvm.psm1/nvm.shintegration lines are now always removed — including legacy literal-temp-path variants written by old versions (these could not be matched by nvm_dir and accumulated by the hundreds on a real user machine).Bug 2 — tests polluted real user profiles:
The temp-dir write guard only checked
TMPDIR, which never exists on Windows, so un-isolated tests wrote hundreds of literal.tmp*PATH lines into real profiles.nvm_dir_in_tempchecksTMPDIR/TMP/TEMP; applied toupdate_shell_config,migrate_rc_to_shim_mode, andinit ensure_shell_config.ps_repairtest no longer scans real profiles;install_integrity,use_uninstall, andcommon::run_isolated_with_homenow isolateUSERPROFILEtoo.Test plan
cargo fmt --check,cargo clippy --all-targets -- -D warnings,cargo test --all(local, all green)uninstall --selfcleans both profiles, preserves user content