mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-12-18 02:20:09 +00:00
Adding an uninstaller tool
This commit is contained in:
parent
6fd7da65a3
commit
e1f5c0c703
3 changed files with 28 additions and 0 deletions
|
@ -41,6 +41,10 @@ TODO: Update this..
|
||||||
* Theme support: Change the @ZSH_THEME@ environment variable in @~/.zshrc@.
|
* Theme support: Change the @ZSH_THEME@ environment variable in @~/.zshrc@.
|
||||||
* much much more..
|
* much much more..
|
||||||
|
|
||||||
|
h3. Uninstalling
|
||||||
|
|
||||||
|
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).
|
||||||
|
|
||||||
h2. Thanks
|
h2. Thanks
|
||||||
|
|
||||||
* Rick Olsen (technoweenie) might remember some of the configuration, which I took from a pastie a few years ago.
|
* Rick Olsen (technoweenie) might remember some of the configuration, which I took from a pastie a few years ago.
|
||||||
|
|
|
@ -27,3 +27,7 @@ function remote_console() {
|
||||||
function zsh_stats() {
|
function zsh_stats() {
|
||||||
history | awk '{print $2}' | sort | uniq -c | sort -rn | head
|
history | awk '{print $2}' | sort | uniq -c | sort -rn | head
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function uninstall_oh_my_zsh() {
|
||||||
|
/bin/sh $ZSH/tools/uninstall.sh
|
||||||
|
}
|
20
tools/uninstall.sh
Normal file
20
tools/uninstall.sh
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
echo "Removing ~/.oh-my-zsh"
|
||||||
|
if [[ -d ~/.oh-my-zsh ]]
|
||||||
|
then
|
||||||
|
rm -rf ~/.oh-my-zsh
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Looking for an existing zsh config..."
|
||||||
|
if [ -f ~/.zshrc.pre-oh-my-zsh ] || [ -h ~/.zshrc.pre-oh-my-zsh ]
|
||||||
|
then
|
||||||
|
echo "Found ~/.zshrc. Backing up to ~/.zshrc.pre-oh-my-zsh";
|
||||||
|
rm ~/.zshrc;
|
||||||
|
cp ~/.zshrc.pre-oh-my-zsh ~/.zshrc;
|
||||||
|
source ~/.zshrc;
|
||||||
|
else
|
||||||
|
echo "Switching back to bash"
|
||||||
|
chsh -s /bin/bash
|
||||||
|
source /etc/profile
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Thanks for trying out Oh My Zsh. It's been uninstalled."
|
Loading…
Reference in a new issue