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

Do not overwrite backup bashrc #284

Merged
merged 2 commits into from
Jan 12, 2022

Conversation

akinomyoga
Copy link
Contributor

@akinomyoga akinomyoga commented Jan 5, 2022

This fixes the issue reported at #115 and #267. We should not overwrite the existing backup file. In this PR, I take the approach suggested by @alexpfx in #115; The backup filename now contains the timestamp. Also, in recovering the original bashrc, we search for the latest backed-up .bashrc that does not contain source oh-my-bash.sh. Additionally, the code of chsh -s bash in uninstallation, which makes sense only for oh-my-zsh, has been removed.


Resolve #267 / Resolve #115

@akinomyoga akinomyoga force-pushed the do-not-overwrite-backup-bashrc branch from a5bdefb to 4d01b2f Compare January 5, 2022 11:04
@akinomyoga akinomyoga mentioned this pull request Jan 5, 2022
@akinomyoga akinomyoga requested a review from nntoan January 5, 2022 14:35
akinomyoga and others added 2 commits January 8, 2022 15:41
The code is originated from the uninstallation script for ohmyzsh,
which switches the default shell from Bash to Zsh in its installation.
Oh-my-bash does not change the default shell in its installation, so
there is no need to change it back to /bin/bash in the uninstallation.
Co-authored-by: Alexandre Alessi <alexpfba@gmail.com>
@akinomyoga akinomyoga force-pushed the do-not-overwrite-backup-bashrc branch from 4d01b2f to 1543bc9 Compare January 8, 2022 06:41
@akinomyoga akinomyoga merged commit 36ecc0a into ohmybash:master Jan 12, 2022
@akinomyoga akinomyoga deleted the do-not-overwrite-backup-bashrc branch January 12, 2022 08:49
@jeffmcneill
Copy link

This new version should be released, since all distributions still have the old 7.1.0 version, and hence this mindlessly damaging overwrite without notice or backup of .bashrc is still affecting everyone who is downloading the latest release.

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.

oh-my-bash: We should not overwrite existing .bashrc.pre-oh-my-bash Install script overwrites .bashrc file
2 participants