-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·43 lines (36 loc) · 920 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
#!/usr/bin/env bash
# make symlinks
dir=~/dotfiles
olddir=~/dotfiles_old
files="zshrc vimrc vim gitconfig tmux.conf oh-my-zsh brew_scripts brew_livecheck_watchlist"
if [[ -d $olddir ]]; then
echo "First cleanup your $olddir"
exit 1
fi
echo "Creating $olddir for backup of any dotfiles in ~"
mkdir -p $olddir
echo "...completed!"
cd $dir
for file in $files; do
echo $file
if [ -f ~/.$file -o -d ~/.$file ]; then
mv ~/.$file $olddir && ln -s $dir/$file ~/.$file
else
ln -s $dir/$file ~/.$file
fi
done
echo "...completed!"
install_oh_my_zsh () {
if [[ ! -d $dir/oh-my-zsh/ ]]; then
git clone http://github.com/robbyrussell/oh-my-zsh.git
fi
if [ -f /bin/zsh -o -f /usr/bin/zsh ]; then
if [[ ! $(echo $SHELL) == $(which zsh) ]]; then
echo "Changing shell to zsh..."
chsh -s $(which zsh)
fi
else
echo "You might want to install zsh."
fi
}
install_oh_my_zsh