-
Notifications
You must be signed in to change notification settings - Fork 55
/
install
executable file
·71 lines (57 loc) · 2.19 KB
/
install
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/bin/bash
INSTALLDIR=${1:-$HOME}
if [ "$1" == "-h" ] || [ "$1" == "-?" ] || [ "$1" == "--help" ]; then
echo "$0 <dotfiles install dir>"
echo "Existing dotfiles will be moved to <filename>.old"
exit
fi
for i in .bash .bash_logout .bashrc bin completion
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" ] || [ "$use_vim_configs" == "y" ]; then
mv $INSTALLDIR/.vim $INSTALLDIR/.vim.old
mv $INSTALLDIR/.vimrc $INSTALLDIR/.vimrc.old
ln -s $PWD/.vim $INSTALLDIR/.vim 2> /dev/null
ln -s $PWD/.vimrc $INSTALLDIR/.vimrc 2> /dev/null
fi
echo
echo -en "\nDo you want to use my git configs? [N/y]"
read -n 1 use_git_configs
if [ "$use_git_configs" == "Y" ] || [ "$use_git_configs" == "y" ]; then
echo -e "\nGit 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
fi
if [ ! -d $INSTALLDIR/.node-completion ]; then
mkdir $INSTALLDIR/.node-completion
fi
echo -en "\nDo you want to use my tmux configs? [N/y]"
read -n 1 use_tmux_configs
if [ "$use_tmux_configs" == "Y" ] || [ "$use_tmux_configs" == "y" ]; then
if [ ! -d $HOME/repos ]; then
mkdir $HOME/repos
fi
if [ ! -d $HOME/repos/powerline ]; then
echo -e "\nCloning shawncplus's powerline fork"
git clone -b feature/shawncplus https://github.com/shawncplus/powerline.git $HOME/repos/powerline
fi
mv $INSTALLDIR/.config $INSTALLDIR/.config.old 2> /dev/null
mv $INSTALLDIR/.tmux.conf $INSTALLDIR/.tmux.conf.old 2> /dev/null
ln -s $PWD/.config $INSTALLDIR/.config
ln -s $PWD/.tmux.conf $INSTALLDIR/.tmux.conf
mkdir -p $HOME/.local/bin/
pip install --user --editable=$HOME/repos/powerline/ && ln -s $HOME/repos/powerline/scripts/powerline $HOME/.local/bin/
pip install --user pytz
fi
echo -e "\nInitializing submodules..."
git submodule init && git submodule update
echo "Done. Conflicting existing dotfiles were moved to <file>.old"