ohmyzsh/tools
Paul Frederiksen 4bcd3b5757 fix: prevent .zshrc deletion during uninstall when no backup exists
Fixes #13156

- Enhanced uninstall script to automatically restore .zshrc from uninstall backup
  when no original backup (.zshrc.pre-oh-my-zsh) exists
- Improved install script to create backup even when KEEP_ZSHRC=yes
- Added better user feedback and error handling
- Prevents data loss for users who installed with --keep-zshrc option

The issue occurred when users installed oh-my-zsh with KEEP_ZSHRC=yes
(keeping their existing .zshrc), which didn't create a backup. During
uninstall, their .zshrc would be deleted with no backup to restore.

Now the uninstall process:
1. Creates a timestamped backup of current .zshrc
2. Looks for original backup (.zshrc.pre-oh-my-zsh)
3. If found, restores the original
4. If not found, automatically restores from the uninstall backup
5. Provides clear feedback to the user

This ensures users never lose their .zshrc configuration during uninstall.
2025-09-10 12:37:18 -04:00
..
changelog.sh fix(changelog): show if there are no changes (#12934) 2025-01-23 20:38:12 +01:00
check_for_upgrade.sh fix(updater): detect p10k instant prompt (#12971) 2025-02-13 12:22:23 +01:00
install.sh fix: prevent .zshrc deletion during uninstall when no backup exists 2025-09-10 12:37:18 -04:00
require_tool.sh chore(docs): fix some typos (#11211) 2022-10-03 17:03:53 +02:00
theme_chooser.sh fix(theme-chooser): use env in shebang (#12720) 2024-10-03 10:47:33 +02:00
uninstall.sh fix: prevent .zshrc deletion during uninstall when no backup exists 2025-09-10 12:37:18 -04:00
upgrade.sh fix(cli): support noexec environments (#13042) 2025-03-29 12:55:20 +01:00