/
move-in
executable file
·49 lines (40 loc) · 1.4 KB
/
move-in
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
#!/usr/bin/env zsh
pushd $HOME
if [[ "$(uname -s)" = "Darwin" ]]; then
if ! xcode-select --print-path > /dev/null; then
echo "Requesting install for Command Line Tools, press ENTER to continue."
/usr/bin/xcode-select --install
read
fi
if git --version | grep -vq license; then
echo "You need to accept the Xcode license, press ENTER to continue."
read
sudo xcodebuild -license
fi
fi
if [[ -e $HOME/.home ]]; then
pushd $HOME/.home
git pull
git submodule update --init --recursive
popd
else
git clone --recursive https://github.com/sj26/home .home
fi
if ! grep -q doc/tags .git/modules/.vim/bundle/camelcasemotion/info/exclude; then
echo doc/tags >> .git/modules/.vim/bundle/camelcasemotion/info/exclude
fi
if [[ ! -e .vim/bundle/ctrlp-cmatcher/autoload/fuzzycomt.so ]]; then
pushd .vim/bundle/ctrlp-cmatcher
./install.sh
popd
fi
for file in .ackrc .bin .gemrc .gitconfig .js .pryrc .railsrc .tmux.conf .vim .zsh
[[ -L $file ]] || ln -fs .home/$file
for file in .config/git/{ignore,attributes}
mkdir -p "${file%/*}" && [ -L "$file" ] || ln -fs "$HOME/.home/$file" "$HOME/$file"
for suffix in rc
[[ -L .vim$suffix ]] || ln -fs .vim/$suffix .vim$suffix
for suffix in env profile rc
[[ -L .zsh$suffix ]] || ln -fs .zsh/$suffix .zsh$suffix
[[ "$(uname -s)" = "Darwin" ]] && .home/move-in-osx
popd