forked from wadey/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·33 lines (28 loc) · 889 Bytes
/
install.sh
File metadata and controls
executable file
·33 lines (28 loc) · 889 Bytes
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
#!/bin/sh
SH_FILES="zshrc zsh gitconfig gitignore vimrc vim ackrc ctags tmux.conf slate.js psqlrc"
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