dotfiles/install/install.sh

50 lines
1.2 KiB
Bash
Raw Normal View History

2012-10-31 11:53:33 +00:00
#!/bin/bash
# Dotfiles and bootstrap installer
# Installs git, clones repository and symlinks dotfiles to your home directory
if ! command -v git >/dev/null 2>&1; then
if [ `uname` == 'Darwin' ]; then
2012-10-31 12:22:42 +00:00
# Install Homebrew
2012-10-31 11:53:33 +00:00
ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)"
2012-10-31 12:22:42 +00:00
# Install Git
2012-10-31 11:53:33 +00:00
brew install git
else
echo "Error: Git is required."
exit
fi
fi
2012-10-31 12:30:26 +00:00
# Clone dotfiles and make symlinks
2012-10-31 11:53:33 +00:00
echo "Installing dotfiles..."
2012-11-28 08:59:07 +00:00
cd ~ && git clone git@github.com:sapegin/dotfiles.git && cd dotfiles && ./sync.py
2012-10-31 11:53:33 +00:00
source ~/.bashrc
2012-10-31 12:30:26 +00:00
echo "Dotfiles installed successfully."
2012-10-31 11:53:33 +00:00
if [ `uname` == 'Darwin' ]; then
2012-10-31 12:22:42 +00:00
# Copy path to clipboard
2012-10-31 11:53:33 +00:00
echo -n "~/dotfiles/setup/bootstrap.sh" | pbcopy
echo
2012-10-31 12:30:26 +00:00
echo "Path to bootstrap script copied to clipboard."
2012-10-31 11:53:33 +00:00
fi
# Nyan cat
# https://github.com/steckel/Git-Nyan-Graph/blob/master/nyan.sh
e='\033'
RESET="$e[0m"
BOLD="$e[1m"
CYAN="$e[0;96m"
RED="$e[0;91m"
YELLOW="$e[0;93m"
GREEN="$e[0;92m"
echo
echo -en $RED'-_-_-_-_-_-_-_'
echo -e $RESET$BOLD',------,'$RESET
echo -en $YELLOW'_-_-_-_-_-_-_-'
echo -e $RESET$BOLD'| /\_/\\'$RESET
echo -en $GREEN'-_-_-_-_-_-_-'
echo -e $RESET$BOLD'~|__( ^ .^)'$RESET
echo -en $CYAN'-_-_-_-_-_-_-'
echo -e $RESET$BOLD'"" ""'$RESET