424800e881ba8140e7c6472687314c51f14b1605
- Author
- Marc Cornellà <marc.cornella@live.com>
- Committer
- Marc Cornellà <marc.cornella@live.com>
- Date
Message
Merge pull request #4539 from Gnouc/master
Update uninstall.sh
Diff
1diff --git a/tools/uninstall.sh b/tools/uninstall.sh
2index 9ad1b64a668fce464914cc1c04eab02b7e729d1b..bf2244be859720a99f10052ad64afc1b45978bee 100644
3--- a/tools/uninstall.sh
4+++ b/tools/uninstall.sh
5@@ -1,34 +1,29 @@
6 read -r -p "Are you sure you want to remove Oh My Zsh? [y/N] " confirmation
7-if [ "$confirmation" != y ] && [ "$confirmation" != Y ]
8-then
9+if [ "$confirmation" != y ] && [ "$confirmation" != Y ]; then
10 echo "Uninstall cancelled"
11 exit
12 fi
13
14 echo "Removing ~/.oh-my-zsh"
15-if [ -d ~/.oh-my-zsh ]
16-then
17+if [ -d ~/.oh-my-zsh ]; then
18 rm -rf ~/.oh-my-zsh
19 fi
20
21 echo "Looking for original zsh config..."
22-if [ -f ~/.zshrc.pre-oh-my-zsh ] || [ -h ~/.zshrc.pre-oh-my-zsh ]
23-then
24+if [ -f ~/.zshrc.pre-oh-my-zsh ] || [ -h ~/.zshrc.pre-oh-my-zsh ]; then
25 echo "Found ~/.zshrc.pre-oh-my-zsh -- Restoring to ~/.zshrc";
26
27- if [ -f ~/.zshrc ] || [ -h ~/.zshrc ]
28- then
29- ZSHRC_SAVE=".zshrc.omz-uninstalled-`date +%Y%m%d%H%M%S`";
30+ if [ -f ~/.zshrc ] || [ -h ~/.zshrc ]; then
31+ ZSHRC_SAVE=".zshrc.omz-uninstalled-$(date +%Y%m%d%H%M%S)";
32 echo "Found ~/.zshrc -- Renaming to ~/${ZSHRC_SAVE}";
33- mv ~/.zshrc ~/${ZSHRC_SAVE};
34+ mv ~/.zshrc ~/"${ZSHRC_SAVE}";
35 fi
36
37 mv ~/.zshrc.pre-oh-my-zsh ~/.zshrc;
38
39- source ~/.zshrc;
40+ echo "Your original zsh config was restored. Please restart your session."
41 else
42- if hash chsh >/dev/null 2>&1
43- then
44+ if hash chsh >/dev/null 2>&1; then
45 echo "Switching back to bash"
46 chsh -s /bin/bash
47 else