Install scripts now update if already installed

This commit is contained in:
Henrik Lissner 2013-03-17 00:28:28 -04:00
parent c346ed19e8
commit 90bd3775ef
6 changed files with 107 additions and 108 deletions

View file

@ -1,18 +1,10 @@
# Dotfiles of a spaghetti code warrior # Dotfiles of a spaghetti code warrior
The magicks! My mac dotfiles.
## Installation ## Installation
### Mac
./installdeps-mac.sh sh <(curl https://raw.github.com/hlissner/dotfiles/master/install.sh -L)
./osx
./brew
./rvm
### Ubuntu
./installdeps-ubuntu.sh
## And if you want vim... ## And if you want vim...

View file

@ -1,35 +1,9 @@
#!/bin/zsh #!/bin/zsh
# Homebrew ##################### src=$(cd "$(dirname "$0")"; pwd)
echo "\n* Updating homebrew"
brew update
brew upgrade
$src/install/brew
$src/install/rvm
$src/install/vim
# RUBY ######################### echo "\nAll done!"
# Make sure rvm is sourced properly
if [ -f ~/.rvm/scripts/rvm ]; then
[[ "$(type rvm)" =~ "function$" ]] || source ~/.rvm/scripts/rvm
fi
# Update all rubies and rubygems
for v in 1.9.3 1.8.7; do
echo "\n* Updating ruby $v"
rvm use $v
gem update --system
gem update
done
# Update system ruby
echo "\n* Updating system ruby"
rvm use system
sudo gem update --system
sudo gem update
# Vim ##########################
echo "\n* Updating vim..."
vim +BundleInstall! +BundleClean! +q +q
echo "\nDone!"

13
install.sh Normal file
View file

@ -0,0 +1,13 @@
#!/bin/bash
src=$(cd "$(dirname "$0")"; pwd)
$src/install/osx
$src/install/zsh
$src/install/brew
$src/install/git
$src/install/rvm
echo "\nDone!"
echo "\nAnd if you want to install vim, run:"
echo "\n sh <(curl https://raw.github.com/hlissner/mlvim/master/install.sh -L)"

View file

@ -5,46 +5,46 @@ if [ ! `command -v "brew"` ]; then
echo "\n* Installing homebrew" echo "\n* Installing homebrew"
# http://mxcl.github.com/homebrew/ # http://mxcl.github.com/homebrew/
ruby <(curl -fsSkL raw.github.com/mxcl/homebrew/go) ruby <(curl -fsSkL raw.github.com/mxcl/homebrew/go)
echo "\n* Setting up homebrew"
# Install GNU core utilities (those that come with OS X are outdated)
brew install coreutils
echo "Dont 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
brew install ack
brew install git
brew install rename
brew install tree
# vim
brew install python ruby
brew install node nginx ctags
brew install php54 --with-fpm --with-imap --with-mysql --with-pgsql --without-apache
brew install php54-imagick php54-mcrypt php54-xdebug readline
brew install php54-intl
brew install macvim
else
echo "\n* Updating homebrew"
# Make sure were using the latest Homebrew
brew update
# Upgrade any already-installed formulae
brew upgrade
fi fi
echo "\n* Updating homebrew"
# Make sure were 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 "Dont 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
brew install ack
brew install git
brew install rename
brew install tree
# vim
brew install python ruby
brew install node nginx ctags
brew install php54 --with-fpm --with-imap --with-mysql --with-pgsql --without-apache
brew install php54-imagick php54-mcrypt php54-xdebug readline
brew install php54-intl
brew install macvim
echo "\n* Cleaning up homebrew" echo "\n* Cleaning up homebrew"
# Remove outdated versions from the cellar # Remove outdated versions from the cellar
brew cleanup brew cleanup

View file

@ -3,35 +3,44 @@
echo "[RVM]" echo "[RVM]"
if [ ! `command -v "rvm"` ]; then if [ ! `command -v "rvm"` ]; then
# If RVM's not installed, install it and the rubies
echo "\n* Installing RVM" echo "\n* Installing RVM"
# https://rvm.io # https://rvm.io
curl -L https://get.rvm.io | bash -s stable --ruby curl -L https://get.rvm.io | bash -s stable --ruby
echo "\n* Install rubies"
# Install rubies and update rubygems
rvm install 1.9.3
rvm install 1.8.7-p371
# But ultimately, the system should be the default
rvm --default use system
# A few prerequisites
sudo gem install bluecloth capistrano bundler
else
# Otherwise, update it
# Make sure rvm is sourced properly
if [ -f ~/.rvm/scripts/rvm ]; then
[[ "$(type rvm)" =~ "function$" ]] || source ~/.rvm/scripts/rvm
fi
# Update all rubies and rubygems
for v in 1.9.3 1.8.7; do
echo "\n* Updating ruby $v"
rvm use $v
gem update --system
gem update
done
# Update system ruby
echo "\n* Updating system ruby"
rvm use system
sudo gem update --system
sudo gem update
fi 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
gem update --system
gem update
rvm install 1.8.7-p371
rvm use 1.8.7
gem update --system
gem update
# But ultimately, the system should be the default
rvm --default use system
# A few prerequisites
gem install bluecloth capistrano bundler
echo "\nDone!" echo "\nDone!"

View file

@ -5,10 +5,21 @@ if [ ! `command -v "brew"` ]; then
exit exit
fi fi
echo "\n* Installing macvim" if [ ! `command -v "mvim"` ]; then
brew install macvim --with-cscope --override-system-vim echo "\n* Installing macvim"
brew install macvim --with-cscope --override-system-vim
fi
echo "\n* Installing vim rcfiles" if [ ! -d ~/.vimrc ]; then
sh <(curl https://raw.github.com/hlissner/mlvim/master/install.sh -L) echo "\n* Installing vim rcfiles"
if [ -d ~/.vim ]; then
rm -rf ~/.vim
fi
sh <(curl https://raw.github.com/hlissner/mlvim/master/install.sh -L)
fi
echo "\n* Updating vim..."
vim +BundleInstall! +BundleClean! +q +q
echo "\nDone!" echo "\nDone!"