forked from shawncplus/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall
More file actions
executable file
·44 lines (34 loc) · 1.03 KB
/
install
File metadata and controls
executable file
·44 lines (34 loc) · 1.03 KB
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
#!/bin/bash
echo "Old .dotfiles moved to .file.old";
INSTALLDIR=${1:-$HOME}
for i in .bash .bash_logout .bashrc bin completion .tmux.conf .tmux-powerlinerc
do
mv $INSTALLDIR/$i $INSTALLDIR/$i.old 2> /dev/null
ln -s $PWD/$i $INSTALLDIR/$i;
done;
echo -n "Do you want to use my vim configs? [n/Y]"
read -n 1 use_vim_configs
if [ "$use_vim_configs" == "Y" ]; then
ln -s $PWD/.vim $INSTALLDIR/.vim
ln -s $PWD/.vimrc $INSTALLDIR/.vimrc
fi
echo
echo "Git config settings"
echo -n "Name: "
read git_name
echo -ne "\nEmail: "
read git_email
cp $PWD/.gitconfig $INSTALLDIR/.gitconfig
sed -i "s/%%GITNAME%%/$git_name/" $INSTALLDIR/.gitconfig
sed -i "s/%%GITEMAIL%%/$git_email/" $INSTALLDIR/.gitconfig
if [ ! -d $INSTALLDIR/.node-completion ]; then
mkdir $INSTALLDIR/.node-completion
fi
if [ ! -d $HOME/repos ]; then
mkdir $HOME/repos
fi
if [ ! -d $HOME/repos/tmux-powerline ]; then
git clone git://github.com/erikw/tmux-powerline.git $HOME/repos/tmux-powerline
fi
echo "Initializing submodules..."
git submodule init && git submodule update