2013-03-22 18:08:25 -07:00
|
|
|
|
#!/usr/bin/env bash
|
2013-03-22 10:15:50 -07:00
|
|
|
|
|
2013-03-22 18:08:25 -07:00
|
|
|
|
INSTALL_DIR="$HOME/.dotfiles"
|
2013-03-22 10:15:50 -07:00
|
|
|
|
|
|
|
|
|
##### GIT & DOTFILES ######
|
|
|
|
|
# If the install folder doesn't exist, you bash < <(curl ...)'d this script!
|
2013-03-22 18:08:25 -07:00
|
|
|
|
if [ ! -d "$INSTALL_DIR" ]; then
|
2013-03-22 10:15:50 -07:00
|
|
|
|
# Check for git and install it if necessary
|
2013-03-22 18:08:25 -07:00
|
|
|
|
if ! command -v "git" 2>&1 >/dev/null; then
|
|
|
|
|
echo "GIT isn't installed! Please install it."
|
|
|
|
|
exit 1
|
2013-03-22 10:15:50 -07:00
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# Get the dotfiles
|
2013-03-22 18:08:25 -07:00
|
|
|
|
echo "$(tput setaf 2)==> Cloning dotfiles repo$(tput sgr0)"
|
2013-03-22 13:27:49 -07:00
|
|
|
|
git clone https://github.com/hlissner/dotfiles.git "$INSTALL_DIR"
|
|
|
|
|
|
2013-03-22 13:31:54 -07:00
|
|
|
|
ln -sf "$INSTALL_DIR/gitconfig" ~/.gitconfig
|
|
|
|
|
ln -sf "$INSTALL_DIR/gitignore" ~/.gitignore
|
2013-03-22 18:08:25 -07:00
|
|
|
|
else
|
|
|
|
|
echo "$(tput setaf 1)==> Dotfiles are already installed$(tput sgr0)"
|
2013-03-22 10:15:50 -07:00
|
|
|
|
fi
|
|
|
|
|
|
2013-03-22 18:08:25 -07:00
|
|
|
|
###### DEPENDENCIES #######
|
2013-03-22 13:27:49 -07:00
|
|
|
|
source "$INSTALL_DIR/zsh/functions"
|
|
|
|
|
|
2013-03-22 10:15:50 -07:00
|
|
|
|
if is_mac; then
|
|
|
|
|
# Set up the OSX options
|
2013-03-22 13:31:54 -07:00
|
|
|
|
$INSTALL_DIR/install/osx
|
2013-03-22 10:15:50 -07:00
|
|
|
|
|
|
|
|
|
# Detect homebrew; install it if necessary
|
|
|
|
|
if ! command_exists brew; then
|
|
|
|
|
echo-g "==> Installing Homebrew"
|
|
|
|
|
|
|
|
|
|
# http://mxcl.github.com/homebrew/
|
|
|
|
|
ruby <(curl -fsSkL raw.github.com/mxcl/homebrew/go)
|
|
|
|
|
|
|
|
|
|
# Reregister the PATH so bash sees brew and its minions
|
|
|
|
|
PATH=/usr/local/bin:/usr/local/sbin:$PATH
|
|
|
|
|
|
|
|
|
|
# Install GNU core utilities (those that come with OS X are outdated)
|
|
|
|
|
brew install coreutils
|
|
|
|
|
# echo "Don’t forget to add $(brew --prefix coreutils)/libexec/gnubin to \$PATH."
|
|
|
|
|
# Install GNU `find`, `locate`, `updatedb`, and `xargs`, g-prefixed
|
|
|
|
|
brew install findutils
|
|
|
|
|
# Install Bash 4
|
|
|
|
|
brew install bash
|
|
|
|
|
# Install wget with IRI support
|
|
|
|
|
brew install wget --enable-iri
|
|
|
|
|
|
|
|
|
|
# Install more recent versions of some OS X tools
|
|
|
|
|
brew tap homebrew/dupes
|
|
|
|
|
brew install homebrew/dupes/grep
|
|
|
|
|
brew tap josegonzalez/homebrew-php
|
|
|
|
|
|
|
|
|
|
# Install everything else
|
2013-03-22 18:08:25 -07:00
|
|
|
|
brew install ack rename tree node nginx memcached ctags
|
2013-03-22 10:15:50 -07:00
|
|
|
|
brew install php54 --with-fpm --with-imap --with-mysql --with-pgsql --without-apache
|
|
|
|
|
brew install php54-imagick php54-mcrypt php54-xdebug readline
|
|
|
|
|
|
|
|
|
|
echo-g "==> Homebrew: Updating"
|
|
|
|
|
brew update && brew upgrade
|
|
|
|
|
|
|
|
|
|
echo-g "==> Homebrew: Cleaning up"
|
|
|
|
|
brew cleanup
|
|
|
|
|
else
|
|
|
|
|
echo-r "==> Homebrew is already installed!"
|
|
|
|
|
fi
|
|
|
|
|
elif is_linux; then
|
2013-03-22 13:31:54 -07:00
|
|
|
|
echo-g "==> Installing dependencies"
|
2013-03-22 10:15:50 -07:00
|
|
|
|
pkg-install curl python ruby wget zsh
|
|
|
|
|
|
|
|
|
|
echo-g "==> Aptitude: Updating"
|
|
|
|
|
pkg-update
|
|
|
|
|
|
|
|
|
|
echo-g "==> Aptitude: Cleaning up"
|
|
|
|
|
pkg-clean
|
|
|
|
|
fi
|
|
|
|
|
|
2013-03-22 18:08:55 -07:00
|
|
|
|
# https://github.com/jamiew/git-friendly
|
|
|
|
|
if ! command_exists "branch"; then
|
|
|
|
|
echo-g "==> Installing git-friendly"
|
|
|
|
|
bash < <(curl https://raw.github.com/jamiew/git-friendly/master/install.sh)
|
|
|
|
|
fi
|
|
|
|
|
|
2013-03-22 10:15:50 -07:00
|
|
|
|
# Install & setup ZSH shell
|
2013-03-22 13:31:54 -07:00
|
|
|
|
$INSTALL_DIR/install/zsh
|
2013-03-22 10:15:50 -07:00
|
|
|
|
|
|
|
|
|
# Install RVM & setup 1.8.7, 1.9.2 rubies
|
2013-03-22 13:31:54 -07:00
|
|
|
|
$INSTALL_DIR/install/rvm
|
2013-03-22 10:15:50 -07:00
|
|
|
|
|
|
|
|
|
# Install & setup TMUX
|
2013-03-22 13:31:54 -07:00
|
|
|
|
$INSTALL_DIR/install/tmux
|
2013-03-22 10:15:50 -07:00
|
|
|
|
|
|
|
|
|
# Install & setup VIM
|
2013-03-22 13:31:54 -07:00
|
|
|
|
$INSTALL_DIR/install/vim
|
2013-03-22 10:15:50 -07:00
|
|
|
|
|
|
|
|
|
# Wrap things up
|
|
|
|
|
echo
|
|
|
|
|
echo-g "Done!"
|
|
|
|
|
echo "And if you want to install vim, run:"
|
|
|
|
|
echo " sh <(curl https://raw.github.com/hlissner/mlvim/master/install.sh -L)"
|