Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 78 lines (58 sloc) 1.7 KB
#!/bin/sh
ZSH=$HOME/.oh-my-zsh
DOT=$HOME/.dotfiles
DOTZSH=$DOT/zsh
ZSH_CUSTOM=$DOTZSH/custom
RED="\033[1;31m"
GREEN="\033[1;32m"
NOCOLOR="\033[0m"
sudo -v
echo "${GREEN}Initializing...${NOCOLOR}"
if [[ `uname` == 'Darwin' ]]; then
# install homebrew if needed
if test ! $(which brew); then
echo "${GREEN}Installing homebrew...${NOCOLOR}"
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
# update all the things
echo "${GREEN}Updating brew...${NOCOLOR}"
brew update
# install all the things
echo "${GREEN}Installing Brewfile...${NOCOLOR}"
brew bundle --file=macos/Brewfile
# setup mac defaults
echo "${GREEN}Settings OS X defaults...${NOCOLOR}"
source macos/defaults.sh
fi
# if this happens, we're not on Darwin
if test ! $(which zsh); then
if test $(which apt-get); then
apt-get -y install zsh git
fi
if test $(which yum); then
yum -y install zsh git
fi
fi
sudo -v
# use ZSH, thank you
# TODO: Make sure /usr/local/bin/zsh (brew zsh) is in /etc/shells
echo "${GREEN}Changing shell to zsh...${NOCOLOR}"
chsh -s $(which zsh)
# setup .zshrc
echo "${GREEN}Setting up .zshrc...${NOCOLOR}"
rm -f $HOME/.zshrc
ln -s $DOT/zshrc $HOME/.zshrc
# setup oh-my-zsh
echo "${GREEN}Setting up .oh-my-zsh...${NOCOLOR}"
rm -df $HOME/.oh-my-zsh
ln -s $DOTZSH/oh-my-zsh $HOME/.oh-my-zsh
echo "${GREEN}Setting up vim...${NOCOLOR}"
rm -f $HOME/.vimrc
ln -s $DOT/vimrc $HOME/.vimrc
rm -df $HOME/.vim
ln -s $DOT/vim $HOME/.vim
vim -c 'PluginInstall' -c 'qa!'
echo "${GREEN}Setting up tmux...${NOCOLOR}"
rm -f $HOME/.tmux.conf
ls -s $DOT/tmux.conf $HOME/.tmux.conf
echo "${GREEN}Done!${NOCOLOR}"