rustup icon indicating copy to clipboard operation
rustup copied to clipboard

Avoid removing partial paths when uninstalling

Open x3ro opened this issue 3 years ago • 0 comments

Fixes #2967

  • Adds a regression test
  • Changes the behaviour of do_remove_from_paths so 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 :)

x3ro avatar Oct 14 '22 18:10 x3ro