forked from carlhuda/janus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbootstrap.sh
executable file
·32 lines (27 loc) · 950 Bytes
/
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
# Source RVM so janus .rvmrc takes effect
[[ -s /usr/local/rvm/scripts/rvm ]] && source /usr/local/rvm/scripts/rvm
[[ -s $HOME/.rvm/scripts/rvm ]] && source $HOME/.rvm/scripts/rvm
# Source Rbenv so janus .rbenv-version takes effect
if ! type rbenv &> /dev/null; then
if [[ -s $HOME/.rbenv/bin/rbenv ]]; then
eval "`$HOME/.rbenv/bin/rbenv init -`"
fi
fi
function die()
{
echo "${@}"
exit 1
}
# Add <strong>.old</strong> to any existing Vim file in the home directory
for i in $HOME/.vim $HOME/.vimrc $HOME/.gvimrc; do
if [[ ( -e $i ) || ( -h $i ) ]]; then
echo "${i} has been renamed to ${i}.old"
mv "${i}" "${i}.old" || die "Could not move ${i} to ${i}.old"
fi
done
# Clone Janus into .vim
git clone https://github.com/carlhuda/janus.git $HOME/.vim \
|| die "Could not clone the repository to ${HOME}/.vim"
# Run rake inside .vim
cd $HOME/.vim || die "Could not go into the ${HOME}/.vim"
rake || die "Rake failed."