-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·60 lines (46 loc) · 1.12 KB
/
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
49
50
51
52
53
54
55
56
57
58
59
60
#!/usr/bin/env bash
function link_file {
source="${PWD}/$1"
target="${HOME}/${1/_/.}"
if [ -e "${target}" ]; then
# It's not a directory and is identical
if [ -f "${target}" ] && cmp $source $target &> /dev/null ; then
echo "Identical: $target"
else
mv $target $target.bak
echo "Linking $target"
ln -sf ${source} ${target}
fi
else
echo "Linking $target"
ln -sf ${source} ${target}
fi
}
echo "Linking dotfiles..."
for i in _*
do
link_file $i
done
cd _vim/
vimfiles=( _vimrc _gvimrc )
for i in ${vimfiles[@]}
do
link_file $i
done
cd ..
echo "Git syncing in main directory"
git submodule sync
git submodule init
git submodule update
git submodule foreach git pull origin master
git submodule foreach git submodule init
git submodule foreach git submodule update
echo "Git syncing in _zsh directory"
cd _zsh/
git submodule sync
git submodule init
git submodule update
git submodule foreach git pull origin master
git submodule foreach git submodule init
git submodule foreach git submodule update
echo "Done!"