Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid removing partial paths when uninstalling #3092

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

x3ro
Copy link

@x3ro x3ro commented Oct 14, 2022

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 x3ro force-pushed the bash-profile-truncation-fix branch from c331adb to 82101cd Compare October 14, 2022 18:09
@x3ro x3ro force-pushed the bash-profile-truncation-fix branch from 82101cd to 5c4b4a5 Compare October 19, 2022 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

installer produced an invalid .bash_profile
1 participant