forked from sontek/homies
/
install.sh
executable file
·48 lines (41 loc) · 887 Bytes
/
install.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
#!/usr/bin/env bash
function link_file {
source="${PWD}/$1"
target="${HOME}/${1/_/.}"
if [ -e "${target}" ] && [ ! -L "${target}" ]; then
mv $target $target.df.bak
fi
ln -sf ${source} ${target}
}
function unlink_file {
source="${PWD}/$1"
target="${HOME}/${1/_/.}"
if [ -e "${target}.df.bak" ] && [ -L "${target}" ]; then
unlink ${target}
mv $target.df.bak $target
fi
}
if [ "$1" = "vim" ]; then
for i in _vim*
do
link_file $i
done
elif [ "$1" = "restore" ]; then
for i in _*
do
unlink_file $i
done
exit
else
for i in _*
do
link_file $i
done
fi
git submodule update --init --recursive
git submodule foreach --recursive git pull origin master
# Extra installation required for YCM
pushd .
cd _vim/bundle/YouCompleteMe
source install.sh --clang-completer
popd