Browse code

Adding an uninstaller tool

Robby Russell authored on 31/08/2009 at 22:00:38
Showing 3 changed files
... ...
@@ -41,6 +41,10 @@ TODO: Update this..
41 41
 * Theme support: Change the @ZSH_THEME@ environment variable in @~/.zshrc@.
42 42
 * much much more..
43 43
 
44
+h3. Uninstalling
45
+
46
+If you want to uninstall it, just run @uninstall_oh_my_zsh@ from the command line and it'll remove itself and revert you to bash (or your previous zsh config).
47
+
44 48
 h2. Thanks
45 49
 
46 50
 * Rick Olsen (technoweenie) might remember some of the configuration, which I took from a pastie a few years ago.
... ...
@@ -26,4 +26,8 @@ function remote_console() {
26 26
 
27 27
 function zsh_stats() {
28 28
   history | awk '{print $2}' | sort | uniq -c | sort -rn | head
29
+}
30
+
31
+function uninstall_oh_my_zsh() {
32
+  /bin/sh $ZSH/tools/uninstall.sh
29 33
 }
30 34
\ No newline at end of file
31 35
new file mode 100644
... ...
@@ -0,0 +1,20 @@
0
+echo "Removing ~/.oh-my-zsh"
1
+if [[ -d ~/.oh-my-zsh ]]
2
+then
3
+  rm -rf ~/.oh-my-zsh
4
+fi
5
+
6
+echo "Looking for an existing zsh config..."
7
+if [ -f ~/.zshrc.pre-oh-my-zsh ] || [ -h ~/.zshrc.pre-oh-my-zsh ]
8
+then
9
+  echo "Found ~/.zshrc. Backing up to ~/.zshrc.pre-oh-my-zsh";
10
+  rm ~/.zshrc;
11
+  cp ~/.zshrc.pre-oh-my-zsh ~/.zshrc;
12
+  source ~/.zshrc;
13
+else
14
+  echo "Switching back to bash"
15
+  chsh -s /bin/bash
16
+  source /etc/profile
17
+fi
18
+
19
+echo "Thanks for trying out Oh My Zsh. It's been uninstalled."
0 20
\ No newline at end of file