-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap.sh
executable file
·54 lines (45 loc) · 1.2 KB
/
bootstrap.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/bash
# Helper functions.
function notice { echo -e "\033[1;32m=> $1\033[0m"; }
function error { echo -e "\033[1;31m=> Error: $1\033[0m"; }
# Install dependencies.
yes | sudo apt-get install build-essential git-core curl python-pip
# Install ruby
curl -L get.rvm.io | bash -s stable
echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"' >> ~/.bashrc
source ~/.bashrc
rvm install 1.9.3
rvm use 1.9.3
rvm --default use 1.9.3
yes | gem install bundler
# Copy original .bashrc to .bashrc.local.
if [ -f ~/.bashrc ] && [ ! -f ~/.bashrc.local ]; then
cp ~/.bashrc ~/.bashrc.local
fi
# Are we updating or installing?
if [ -d ~/.dotfiles ]; then
notice "Updating..."
cd ~/.dotfiles
git pull origin master
git submodule init
git submodule update
notice "Installing..."
pip install -U nosecomplete
bundle update
bundle exec rake install
else
notice "Downloading..."
git clone --recursive git://github.com/robingustafsson/dotfiles.git ~/.dotfiles
notice "Installing..."
cd ~/.dotfiles
pip install nosecomplete
bundle update
bundle exec rake install
fi
# Finished.
cd $current_pwd
notice "Done"
# Source dotfiles.
if [ -f ~/.bashrc ] ; then
source ~/.bashrc
fi