-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
executable file
·71 lines (59 loc) · 1.38 KB
/
setup.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
#!/usr/bin/env bash
# arg number check
if [ $# -lt 1 ]
then
echo "Usage: $0 /absolute/path/to/conf/git [--force]"
exit 1
fi
# absolute directory path check
case $1 in
/*)
if [ ! -d "$1" ]
then
echo "$1 is not a directory"
exit 1
fi
;;
*)
echo "$1 is not an absolute path"
exit 1
;;
esac
rmflags="-ivr"
if [ "$2" = "--force" ]
then
rmflags="-fvr"
fi
# dir
echo "Link: ~/.paps -> $1"
rm $rmflags ~/.paps
ln -sT "$1" ~/.paps
# vim
echo "Link: ~/.vimrc -> ~/.paps/vim/vimrc"
rm $rmflags ~/.vimrc
ln -sT ~/.paps/vim/vimrc ~/.vimrc
echo "Link: ~/.vim -> ~/.paps/vim/vim"
rm $rmflags ~/.vim
ln -sT ~/.paps/vim/vim ~/.vim
# nvim
echo "Link: ~/.config/nvim -> ~/.paps/vim/vim"
rm $rmflags ~/.config/nvim
ln -sT ~/.paps/vim/vim ~/.config/nvim
# zsh
echo "Link: ~/.zshrc -> ~/.paps/zsh/zshrc"
rm $rmflags ~/.zshrc
ln -sT ~/.paps/zsh/zshrc ~/.zshrc
echo "Link: ~/.zshenv -> ~/.paps/zsh/zshenv"
rm $rmflags ~/.zshenv
ln -sT ~/.paps/zsh/zshenv ~/.zshenv
echo "Link: ~/.inputrc -> ~/.paps/zsh/inputrc"
rm $rmflags ~/.inputrc
ln -sT ~/.paps/zsh/inputrc ~/.inputrc
# git
echo "Link: ~/.gitconfig -> ~/.paps/git/gitconfig"
rm $rmflags ~/.gitconfig
ln -sT ~/.paps/git/gitconfig ~/.gitconfig
# tmux
echo "Link: ~/.tmux.conf -> ~/.paps/tmux/tmux.conf"
rm $rmflags ~/.tmux.conf
ln -sT ~/.paps/tmux/tmux.conf ~/.tmux.conf