-
Notifications
You must be signed in to change notification settings - Fork 9
/
install.sh
executable file
·35 lines (30 loc) · 935 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
#!/bin/sh
SH_FILES="zshrc zsh gitconfig gitignore vimrc vim gvimrc ackrc screenrc ctags jshintrc"
BACKUP="backups/`date +'%Y%m%d-%H%M%S'`"
SHDIR=$PWD
#if [ -e "$HOME/.dotfiles" -a ! -L "$HOME/.dotfiles" ]; then
# echo "~/.dotfiles already exists"
# exit 1
#fi
#ln -s "$SHDIR" "$HOME/.dotfiles"
if [ ! -d ~/.oh-my-zsh ]; then
git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
fi
for FILE in $SH_FILES; do
if [ -e "$HOME/.$FILE" ]; then
if [ -L "$HOME/.$FILE" ]; then
echo "not backing up ~/.$FILE, it is a symlink -> `readlink $HOME/.$FILE`"
rm "$HOME/.$FILE"
else
echo "backing up ~/.$FILE"
mkdir -p $BACKUP
mv "$HOME/.$FILE" "$BACKUP/$FILE"
fi
fi
echo "installing $FILE"
ln -s "$SHDIR/$FILE" "$HOME/.$FILE"
done
(cd $HOME/.vim && ./update)
mkdir -p ~/.vimundo
mkdir -p ~/.vim/swap
mkdir -p ~/.vim/undo