Skip to content

Commit e166f40

Browse files
committed
Fancy setup script.
1 parent 87a51a6 commit e166f40

File tree

1 file changed

+109
-11
lines changed

1 file changed

+109
-11
lines changed

setup.sh

Lines changed: 109 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,145 @@
11
#!/bin/bash
22

3-
sudo apt-get update
3+
if [ $EUID != 0 ]; then
4+
sudo "$0" "$@"
5+
exit $?
6+
fi
7+
8+
echo -ne "Updating APT..."
9+
sudo apt-get update > /dev/null
410

11+
echo -ne "done\nChecking for git..."
512
if [ ! `which git` ]; then
6-
sudo apt-get install -y git-core
13+
echo -ne "Installing git..."
14+
sudo apt-get install -y git-core > /dev/null
15+
echo "done"
16+
else
17+
echo "git is already installed"
718
fi
819

20+
echo "Checking for curl..."
921
if [ ! `which curl` ]; then
10-
sudo apt-get install -y curl
22+
echo -ne "Installing curl..."
23+
sudo apt-get install -y curl > /dev/null
24+
echo "done"
25+
else
26+
echo "curl is already installed"
1127
fi
1228

29+
echo -ne "Checking for The Silver Searcher..."
1330
if [ ! `which ag` ]; then
14-
sudo apt-get install -y silversearcher-ag
31+
echo -ne "\nInstalling The Silver Searcher..."
32+
sudo apt-get install -y silversearcher-ag > /dev/null
33+
echo "done"
34+
else
35+
echo "The Silver Searcher is already installed"
1536
fi
1637

38+
echo "Installing dotfiles..."
1739
if [ ! -d dotfiles ]; then
18-
git clone https://github.com/zanothis/dotfiles.git
40+
echo -ne " Cloning into dotfiles..."
41+
git clone https://github.com/zanothis/dotfiles.git > /dev/null
42+
echo -ne "done\n Copying dotfiles to \"$HOME\"..."
1943
cp dotfiles/.screenrc ~/
2044
cp dotfiles/.inputrc ~/
2145
cp dotfiles/.vimrc ~/.vimrc
2246
cp dotfiles/.gitconfig ~/.gitconfig
47+
echo "done"
2348
else
2449
cd dotfiles
25-
git pull
50+
echo -ne " Updating dotfiles..."
51+
git pull > /dev/null
2652
cd ..
53+
echo -ne "done\n Copying dotfiles...\n Copying .screenrc..."
2754
cp dotfiles/.screenrc ~/
55+
echo -ne "done\n Copying .inputrc..."
2856
cp dotfiles/.inputrc ~/
57+
echo -ne "done\n Copying .vimrc..."
2958
cp dotfiles/.vimrc ~/.vimrc
59+
echo -ne "done\n Copying .gitconfig..."
3060
cp dotfiles/.gitconfig ~/.gitconfig
61+
echo "done"
3162
fi
3263

64+
echo "Installing vim-packages..."
3365
if [ ! -d vim-packages ]; then
34-
git clone https://github.com/zanothis/vim-packages.git
66+
echo -ne " Cloning into vim-packages..."
67+
git clone https://github.com/zanothis/vim-packages.git > /dev/null
68+
echo "done"
3569

3670
mkdir -p ~/.vim
3771

3872
cd vim-packages
39-
git submodule init
40-
git submodule update
73+
echo -ne " Initializing submodules..."
74+
git submodule update --init --recursive > /dev/null
75+
echo -ne "done\n Copying vim plugins to \"$HOME\"/.vim..."
4176
cp -rf * ~/.vim
77+
78+
echo -ne "done\n Checking for NodeJS..."
79+
if [ `which node` ]; then
80+
echo -ne "found\n Setting up Tern for Vim..."
81+
cd ~/.vim/bundle/ternjs
82+
sudo npm install > /dev/null
83+
echo "done"
84+
else
85+
echo "missing\n Install NodeJS and try again."
86+
fi
87+
88+
echo -ne " Adding Mono packages to APT..."
89+
# Add the Mono Project's GPG key
90+
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF > /dev/null
91+
92+
# Add the Mono packages to apt
93+
echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list > /dev/null
94+
95+
# Update and install
96+
sudo apt-get update > /dev/null
97+
echo -ne "done\n Installing mono-devel..."
98+
sudo apt-get install --install-suggests mono-devel > /dev/null
99+
100+
echo -ne "done\n Building YCM..."
101+
cd ~/.vim/bundle/YouCompleteMe
102+
./install.py --omnisharp-completer > /dev/null
103+
echo "done"
42104
else
43105
cd vim-packages
44-
git pull
45-
git submodule update
106+
echo -ne " Updating vim-packages..."
107+
git pull > /dev/null
108+
echo -ne "done\n Initializing submodules..."
109+
git submodule update --init --recursive > /dev/null
110+
echo -ne "done\n Copying vim plugins..."
46111
cp -rf * ~/.vim
112+
113+
echo -ne "done\n Checking for NodeJS..."
114+
if [ `which node` ]; then
115+
echo -ne "found\n Setting up Tern for Vim..."
116+
cd ~/.vim/bundle/ternjs
117+
sudo npm install > /dev/null
118+
echo "done"
119+
else
120+
echo "missing\n Install NodeJS and try again."
121+
fi
122+
123+
if sudo apt-key finger | grep '3FA7 E032' > /dev/null
124+
then
125+
echo -e " Mono is already installed"
126+
else
127+
echo -ne " Adding Mono packages to APT..."
128+
# Add the Mono Project's GPG key
129+
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF > /dev/null
130+
131+
# Add the Mono packages to apt
132+
echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list > /dev/null
133+
134+
# Update and install
135+
sudo apt-get update > /dev/null
136+
echo -ne "done\n Installing mono-devel..."
137+
sudo apt-get install --install-suggests mono-devel > /dev/null
138+
echo "done"
139+
fi
140+
141+
echo -ne " Building YCM..."
142+
cd ~/.vim/bundle/YouCompleteMe
143+
./install.py --omnisharp-completer > /dev/null
144+
echo "done"
47145
fi

0 commit comments

Comments
 (0)