rustup
rustup copied to clipboard
Avoid removing partial paths when uninstalling
Fixes #2967
- Adds a regression test
- Changes the behaviour of
do_remove_from_pathsso that it only removes full lines - Added normalization of whitespaces (this could also be moved to a separate PR, or removed entirely)
One thing I'm not 100% sure about is whether it's okay to call .lines() and then later re-build the file with .join("\n"). For example in the case of CRLF line breaks, this would certainly rewrite the file entirely. Is this a concern for the Unix implementation?
I'm fairly sure this still needs some work, but the overall idea is correct, I believe. Feedback welcome :)