-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap.sh
More file actions
executable file
·58 lines (47 loc) · 1.08 KB
/
bootstrap.sh
File metadata and controls
executable file
·58 lines (47 loc) · 1.08 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
GIT_NAME="chenkxin"
cp_file_if_exists() {
if [ -f "$1" -a -e $2 ]; then
cp "$1" "$2"
fi
}
LOCAL_DIR=$HOME/.local
[ ! -d $LOCAL_DIR ] && mkdir -p "$LOCAL_DIR"
DOTFILES=$LOCAL_DIR/.Cdotfiles
# initialization for the dotfiles project
check_project() {
if [ ! -d "$DOTFILES" ]; then
git clone --recursive https://github.com/${GIT_NAME}/Cdotfiles $DOTFILES
fi
}
setup_config() {
# zshrc
cp zsh/.zshrc $HOME/
cp_file_if_exists zsh/.zsh_profile $HOME/
# clash
if [ ! -f $HOME/.local/bin/clash ]; then
bash $DOTFILES/clash/install.sh
fi
# tmux
ln -s $DOTFILES/tmux/.tmux/.tmux.conf $HOME/.tmux.conf
cp $DOTFILES/tmux/.tmux/.tmux.conf.local $HOME
# vim
if [ ! -d "$HOME/.vim" ]; then
mkdir $HOME/.vim
fi
ln -s $DOTFILES/vim/vim-init $HOME/.vim
cp $DOTFILES/vim/.vimrc $HOME
# git
cp git/.gitconfig $HOME/
}
install_common_software () {
bash scripts/install.sh
}
main() {
check_project
cd $DOTFILES
install_common_software
setup_config
cd -
exec zsh
}
main