-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·85 lines (78 loc) · 2.46 KB
/
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
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/bin/sh
ask () {
if [ "${2:-}" = "Y" ]; then
defaultString="Y/n"
defaultValue="Y"
elif [ "${2:-}" = "N" ]; then
defaultString="y/N"
defaultValue="N"
else
defaultString="y/n"
defaultValue=
fi
while true; do
read -p "$1 [$defaultString] " answer
if [ -z $answer ]; then
answer=$defaultValue
fi
case $answer in
[Yy]* ) return 0;;
[Nn]* ) return 1;;
esac
done
}
if ask "Install bash?"; then
echo " Installing bash:"
echo " Removing ~/.bashrc"
rm -rf ~/.bashrc
echo " Symlinking ~/.bashrc"
ln -s ~/.dharesign-dotfiles/bashrc ~/.bashrc
echo " Removing ~/.bash_aliases"
rm -rf ~/.bash_aliases
echo " Symlinking ~/.bash_aliases"
ln -s ~/.dharesign-dotfiles/bash_aliases ~/.bash_aliases
echo " Removing ~/.bash_profile"
rm -rf ~/.bash_profile
echo " Symlinking ~/.bash_profile"
ln -s ~/.dharesign-dotfiles/bash_profile ~/.bash_profile
echo " Done installing bash"
fi
if ask "Install fish?"; then
echo " Installing fish:"
echo " Removing ~/.config/fish/config.fish"
rm -rf ~/.config/fish/config.fish
echo " Symlinking ~/.config/fish/config.fish"
mkdir -p ~/.config/fish/
ln -s ~/.dharesign-dotfiles/config.fish ~/.config/fish/config.fish
echo " Done installing fish"
fi
if ask "Install git?"; then
echo " Installing git:"
echo " Removing ~/.gitconfig"
rm -rf ~/.gitconfig
echo " Symlinking ~/.gitconfig"
ln -s ~/.dharesign-dotfiles/gitconfig ~/.gitconfig
echo " Removing ~/.git-completion.bash"
rm -rf ~/.git-completion.bash
echo " Symlinking ~/.git-completion.bash"
ln -s ~/.dharesign-dotfiles/git/contrib/completion/git-completion.bash ~/.git-completion.bash
echo " Removing ~/.git-prompt.sh"
rm -rf ~/.git-prompt.sh
echo " Symlinking ~/.git-prompt.sh"
ln -s ~/.dharesign-dotfiles/git/contrib/completion/git-prompt.sh ~/.git-prompt.sh
echo " Done installing git"
fi
if ask "Install vim?"; then
echo " Installing vim:"
echo " Removing ~/.vim"
rm -rf ~/.vim
echo " Symlinking ~/.vim"
ln -s ~/.dharesign-dotfiles/vim ~/.vim
echo " Removing ~/.vimrc"
rm -rf ~/.vimrc
echo " Symlinking ~/.vimrc"
ln -s ~/.dharesign-dotfiles/vimrc ~/.vimrc
echo " Installing vim plugins"
vim +PluginInstall +qall
echo " Done installing vim."
fi