Conflicts: oh-my-zsh.sh tools/install.sh tools/upgrade.shpull/3/head
parent
8efe424641
commit
0c2beda215
@ -1,35 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
function _current_epoch() {
|
||||
echo $(($(date +%s) / 60 / 60 / 24))
|
||||
}
|
||||
|
||||
function _update_zsh_update() {
|
||||
echo "LAST_EPOCH=$(_current_epoch)" > ~/.zsh-update
|
||||
}
|
||||
|
||||
if [ -f ~/.zsh-update ]
|
||||
then
|
||||
. ~/.zsh-update
|
||||
|
||||
if [[ -z "$LAST_EPOCH" ]]; then
|
||||
_update_zsh_update && return 0;
|
||||
fi
|
||||
|
||||
epoch_diff=$(($(_current_epoch) - $LAST_EPOCH))
|
||||
if [ $epoch_diff -gt 6 ]
|
||||
then
|
||||
echo "[Oh My Zsh] Would you like to check for updates?"
|
||||
echo "Type Y to update oh-my-zsh: \c"
|
||||
read line
|
||||
if [ "$line" = Y ] || [ "$line" = y ]
|
||||
then
|
||||
/bin/sh $ZSH/tools/upgrade.sh
|
||||
# update the zsh file
|
||||
_update_zsh_update
|
||||
fi
|
||||
fi
|
||||
else
|
||||
# create the zsh file
|
||||
_update_zsh_update
|
||||
fi
|
@ -1,36 +0,0 @@
|
||||
if [ -d ~/.oh-my-zsh ]
|
||||
then
|
||||
echo "\033[0;33mYou already have Oh My Zsh installed.\033[0m You'll need to remove ~/.oh-my-zsh if you want to install"
|
||||
exit
|
||||
fi
|
||||
|
||||
echo "\033[0;34mCloning Oh My Zsh...\033[0m"
|
||||
/usr/bin/env git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
|
||||
|
||||
echo "\033[0;34mLooking for an existing zsh config...\033[0m"
|
||||
if [ -f ~/.zshrc ] || [ -h ~/.zshrc ]
|
||||
then
|
||||
echo "\033[0;33mFound ~/.zshrc.\033[0m \033[0;32]Backing up to ~/.zshrc.pre-oh-my-zsh\033[0m";
|
||||
cp ~/.zshrc ~/.zshrc.pre-oh-my-zsh;
|
||||
rm ~/.zshrc;
|
||||
fi
|
||||
|
||||
echo "\033[0;34mUsing the Oh My Zsh template file and adding it to ~/.zshrc\033[0m"
|
||||
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
|
||||
|
||||
echo "\033[0;34mCopying your current PATH and adding it to the end of ~/.zshrc for you.\033[0m"
|
||||
echo "export PATH=$PATH" >> ~/.zshrc
|
||||
|
||||
echo "\033[0;34mTime to change your default shell to zsh!\033[0m"
|
||||
chsh -s `which zsh`
|
||||
|
||||
echo "\033[0;32m"' __ __ '"\033[0m"
|
||||
echo "\033[0;32m"' ____ / /_ ____ ___ __ __ ____ _____/ /_ '"\033[0m"
|
||||
echo "\033[0;32m"' / __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \ '"\033[0m"
|
||||
echo "\033[0;32m"'/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / / '"\033[0m"
|
||||
echo "\033[0;32m"'\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ '"\033[0m"
|
||||
echo "\033[0;32m"' /____/ '"\033[0m"
|
||||
|
||||
echo "\n\n \033[0;32m....is now installed.\033[0m"
|
||||
/usr/bin/env zsh
|
||||
source ~/.zshrc
|
@ -1,20 +0,0 @@
|
||||
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."
|
@ -1,12 +0,0 @@
|
||||
current_path=`pwd`
|
||||
echo "\033[0;34mUpgrading Oh My Zsh\033[0m"
|
||||
( cd $ZSH && git pull origin master )
|
||||
echo "\033[0;32m"' __ __ '"\033[0m"
|
||||
echo "\033[0;32m"' ____ / /_ ____ ___ __ __ ____ _____/ /_ '"\033[0m"
|
||||
echo "\033[0;32m"' / __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \ '"\033[0m"
|
||||
echo "\033[0;32m"'/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / / '"\033[0m"
|
||||
echo "\033[0;32m"'\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ '"\033[0m"
|
||||
echo "\033[0;32m"' /____/ '"\033[0m"
|
||||
echo "\033[0;34mHooray! Oh My Zsh has been updated and/or is at the current version.\033[0m"
|
||||
echo "\033[0;34mTo keep up on the latest, be sure to follow Oh My Zsh on twitter: \033[1mhttp://twitter.com/ohmyzsh\033[0m"
|
||||
cd $current_path
|
Loading…
Reference in new issue