forked from bookercodes/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·78 lines (63 loc) · 1.72 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
#!/usr/bin/env bash
set -e
# Source: https://gist.github.com/davejamesmiller/1965569
ask() {
while true; do
if [ "${2:-}" = "Y" ]; then
prompt="Y/n"
default=Y
elif [ "${2:-}" = "N" ]; then
prompt="y/N"
default=N
else
prompt="y/n"
default=
fi
read -p "$1 [$prompt] " REPLY </dev/tty
if [ -z "$REPLY" ]; then
REPLY=$default
fi
case "$REPLY" in
Y*|y*) return 0 ;;
N*|n*) return 1 ;;
esac
done
}
dir=`pwd`
if ask "Install symlink for .zshrc?" Y; then
ln -sf ${dir}/.zshrc ${HOME}/.zshrc
ln -sf ${dir}/.aliases.sh ${HOME}/.aliases.sh
fi
if ask "Install symlink for .npmrc?" Y; then
ln -sf ${dir}/.npmrc ${HOME}/.npmrc
fi
if ask "Install symlink for .config/termite?" Y; then
ln -sfn ${dir}/.config/termite ${HOME}/.config/termite
fi
if ask "Install symlink for .config/nvim?" Y; then
ln -sfn ${dir}/.config/nvim ${HOME}/.config/nvim
fi
if ask "Install symlink for .config/base16-shell?" Y; then
ln -sfn ${dir}/.config/base16-shell ${HOME}/.config/base16-shell
fi
if ask "Install symlink for .tmux.conf?" Y; then
ln -sf ${dir}/.tmux.conf ${HOME}/.tmux.conf
fi
if ask "Install symlink for .yaourtrc?" Y; then
ln -sf ${dir}/.yaourtrc ${HOME}/.yaourtrc
fi
if ask "Install symlink for .Xresources?" Y; then
ln -sf ${dir}/.Xresources ${HOME}/.Xresources
fi
if ask "Install symlink for .xinitrc?" Y; then
ln -sf ${dir}/.xinitrc ${HOME}/.xinitrc
fi
if ask "Install symlink for .i3blocks.conf?" Y; then
ln -sf ${dir}/.i3blocks.conf ${HOME}/.i3blocks.conf
fi
if ask "Install symlink for .scripts?" Y; then
ln -sfn ${dir}/.scripts ${HOME}/.scripts
fi
if ask "Install symlink for i3?" Y; then
ln -sfn ${dir}/.config/i3 ${HOME}/.config/i3
fi