diff --git a/brew b/install/brew similarity index 77% rename from brew rename to install/brew index f46b8aed..d7eb7018 100755 --- a/brew +++ b/install/brew @@ -1,11 +1,20 @@ #!/bin/bash +echo "[HOMEBREW]" +if [ ! `command -v "brew"` ]; then + echo "\n* Installing homebrew" + # http://mxcl.github.com/homebrew/ + ruby <(curl -fsSkL raw.github.com/mxcl/homebrew/go) +fi + +echo "\n* Updating homebrew" # Make sure we’re using the latest Homebrew brew update # Upgrade any already-installed formulae brew upgrade +echo "\n* Setting up homebrew" # 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." @@ -36,5 +45,8 @@ brew install php54-imagick php54-mcrypt php54-xdebug readline brew install php54-intl brew install macvim +echo "\n* Cleaning up homebrew" # Remove outdated versions from the cellar brew cleanup + +echo "\nDone!" diff --git a/install/git b/install/git new file mode 100755 index 00000000..b102af0c --- /dev/null +++ b/install/git @@ -0,0 +1,29 @@ +#!/bin/bash + +echo "[GIT]" + +if [ ! `command -v "git"` ]; then + if [ ! `command -v "brew"` ]; then + echo "Homebrew is required!" + exit + fi + + echo "\n* Installing git" + brew install git +fi + +if [ ! -e /usr/local/bin/branch ]; then + echo "\n* Install git-friendly" + + # https://github.com/jamiew/git-friendly + bash < <(curl https://raw.github.com/jamiew/git-friendly/master/install.sh) +fi + +# Create links +echo "\n* Setting up symlinks" +src=$(cd "$(dirname "$0")"; pwd) + +ln -sf $src/gitignore ~/.gitignore +ln -sf $src/gitconfig ~/.gitconfig + +echo "\nDone!" diff --git a/osx b/install/osx similarity index 100% rename from osx rename to install/osx diff --git a/rvm b/install/rvm similarity index 70% rename from rvm rename to install/rvm index 3f613722..d9f79ae0 100755 --- a/rvm +++ b/install/rvm @@ -1,11 +1,22 @@ #!/bin/bash +echo "[RVM]" + +if [ ! `command -v "rvm"` ]; then + echo "\n* Installing RVM" + + # https://rvm.io + curl -L https://get.rvm.io | bash -s stable --ruby +fi + # Ask for the administrator password upfront sudo -v # Keep sudo alive while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null & +echo "\n* Install rubies" + # Install rubies and update rubygems rvm install 1.9.3 rvm use 1.9.3 @@ -22,3 +33,5 @@ rvm --default use system # A few prerequisites gem install bluecloth capistrano bundler + +echo "\nDone!" diff --git a/install/vim b/install/vim new file mode 100755 index 00000000..d67ce434 --- /dev/null +++ b/install/vim @@ -0,0 +1,14 @@ +#!/bin/zsh + +if [ ! `command -v "brew"` ]; then + echo "Homebrew is required!" + exit +fi + +echo "\n* Installing macvim" +brew install macvim --with-cscope --override-system-vim + +echo "\n* Installing vim rcfiles" +sh <(curl https://raw.github.com/hlissner/mlvim/master/install.sh -L) + +echo "\nDone!" diff --git a/install/zsh b/install/zsh new file mode 100755 index 00000000..3fb59c5d --- /dev/null +++ b/install/zsh @@ -0,0 +1,22 @@ +#!/bin/bash + +echo "[ZSH]" + +if [ ! -d ~/.oh-my-zsh ]; then + # https://github.com/robbyrussell/oh-my-zsh + echo "\n* Installing oh-my-zsh" + curl -L https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh | sh + + # Set new shell + echo "\n* Changing shell" + chsh -s /bin/zsh +fi + +# Create links +echo "\n* Setting up symlinks" +src=$(cd "$(dirname "$0")"; pwd) + +ln -sf $src/zshrc ~/.zshrc +ln -sf $src/zsh ~/.zsh + +echo "\nDone!"