Install scripts now update if already installed
This commit is contained in:
parent
c346ed19e8
commit
90bd3775ef
12
README.md
12
README.md
|
@ -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...
|
||||||
|
|
||||||
|
|
36
bin/update
36
bin/update
|
@ -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
13
install.sh
Normal 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)"
|
16
install/brew
16
install/brew
|
@ -5,14 +5,6 @@ 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)
|
||||||
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"
|
echo "\n* Setting up homebrew"
|
||||||
# Install GNU core utilities (those that come with OS X are outdated)
|
# Install GNU core utilities (those that come with OS X are outdated)
|
||||||
|
@ -44,6 +36,14 @@ brew install php54 --with-fpm --with-imap --with-mysql --with-pgsql --without-ap
|
||||||
brew install php54-imagick php54-mcrypt php54-xdebug readline
|
brew install php54-imagick php54-mcrypt php54-xdebug readline
|
||||||
brew install php54-intl
|
brew install php54-intl
|
||||||
brew install macvim
|
brew install macvim
|
||||||
|
else
|
||||||
|
echo "\n* Updating homebrew"
|
||||||
|
# Make sure we’re using the latest Homebrew
|
||||||
|
brew update
|
||||||
|
|
||||||
|
# Upgrade any already-installed formulae
|
||||||
|
brew upgrade
|
||||||
|
fi
|
||||||
|
|
||||||
echo "\n* Cleaning up homebrew"
|
echo "\n* Cleaning up homebrew"
|
||||||
# Remove outdated versions from the cellar
|
# Remove outdated versions from the cellar
|
||||||
|
|
39
install/rvm
39
install/rvm
|
@ -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
|
||||||
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"
|
echo "\n* Install rubies"
|
||||||
|
|
||||||
# Install rubies and update rubygems
|
# Install rubies and update rubygems
|
||||||
rvm install 1.9.3
|
rvm install 1.9.3
|
||||||
rvm use 1.9.3
|
|
||||||
gem update --system
|
|
||||||
gem update
|
|
||||||
|
|
||||||
rvm install 1.8.7-p371
|
rvm install 1.8.7-p371
|
||||||
rvm use 1.8.7
|
|
||||||
gem update --system
|
|
||||||
gem update
|
|
||||||
|
|
||||||
# But ultimately, the system should be the default
|
# But ultimately, the system should be the default
|
||||||
rvm --default use system
|
rvm --default use system
|
||||||
|
|
||||||
# A few prerequisites
|
# A few prerequisites
|
||||||
gem install bluecloth capistrano bundler
|
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
|
||||||
|
|
||||||
echo "\nDone!"
|
echo "\nDone!"
|
||||||
|
|
11
install/vim
11
install/vim
|
@ -5,10 +5,21 @@ if [ ! `command -v "brew"` ]; then
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ ! `command -v "mvim"` ]; then
|
||||||
echo "\n* Installing macvim"
|
echo "\n* Installing macvim"
|
||||||
brew install macvim --with-cscope --override-system-vim
|
brew install macvim --with-cscope --override-system-vim
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -d ~/.vimrc ]; then
|
||||||
echo "\n* Installing vim rcfiles"
|
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)
|
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!"
|
||||||
|
|
Loading…
Reference in a new issue