This commit is contained in:
Aditya 2025-10-16 22:01:20 +05:30 committed by GitHub
commit ba4ff817c8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -22,19 +22,34 @@ if [ -d ~/.oh-my-zsh ]; then
fi fi
if [ -e ~/.zshrc ]; then if [ -e ~/.zshrc ]; then
ZSHRC_SAVE=~/.zshrc.omz-uninstalled-$(date +%Y-%m-%d_%H-%M-%S) BACKUP=~/.zshrc.backup-$(date +%Y-%m-%d_%H-%M-%S)
echo "Found ~/.zshrc -- Renaming to ${ZSHRC_SAVE}" echo "Backing up your current ~/.zshrc to ${BACKUP}"
mv ~/.zshrc "${ZSHRC_SAVE}" cp ~/.zshrc "${BACKUP}"
# Remove only oh-my-zsh related lines
if grep -q 'oh-my-zsh.sh' ~/.zshrc; then
sed -i '/oh-my-zsh.sh/d' ~/.zshrc
echo "Removed Oh My Zsh initialization from ~/.zshrc"
fi
if grep -q 'plugins=(' ~/.zshrc; then
sed -i '/plugins=(/d' ~/.zshrc
echo "Removed Oh My Zsh plugin line from ~/.zshrc"
fi
if grep -q 'ZSH_THEME=' ~/.zshrc; then
sed -i '/ZSH_THEME=/d' ~/.zshrc
echo "Removed Oh My Zsh theme setting from ~/.zshrc"
fi
fi fi
echo "Looking for original zsh config..." echo "Looking for original zsh config..."
ZSHRC_ORIG=~/.zshrc.pre-oh-my-zsh ZSHRC_ORIG=~/.zshrc.pre-oh-my-zsh
if [ -e "$ZSHRC_ORIG" ]; then if [ -e "$ZSHRC_ORIG" ]; then
echo "Found $ZSHRC_ORIG -- Restoring to ~/.zshrc" echo "Found $ZSHRC_ORIG (not restoring automatically)."
mv "$ZSHRC_ORIG" ~/.zshrc echo "You can restore it manually if needed: cp $ZSHRC_ORIG ~/.zshrc"
echo "Your original zsh config was restored."
else else
echo "No original zsh config found" echo "No original zsh config found. Your current ~/.zshrc was cleaned."
fi fi
echo "Thanks for trying out Oh My Zsh. It's been uninstalled." echo "Thanks for trying out Oh My Zsh. It's been uninstalled."