-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
executable file
·32 lines (31 loc) · 1007 Bytes
/
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
#!/bin/bash -ex
DOTFILE_PATH=$(pwd)
if [ ! -d ~/.oh-my-zsh ]; then
curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh | sh -s -- -y
fi
if [ ! -d ~/.zplug/ ]; then
curl -sL --proto-redir -all,https https://raw.githubusercontent.com/zplug/installer/master/installer.zsh | zsh
fi
if [ ! -d ~/.tmux/plugins/tpm ]; then
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
fi
mkdir -p ~/.config
create_symlink(){
src=$1
dest=$2
force=$3
if [ -e "$dest" ] && [ -n "$force" ]; then
rm "$dest"
fi
if [ -e "$dest" ]; then
echo "$dest exists. Skipping."
else
mkdir -p "$(dirname "$dest")"
ln -s "$src" "$dest"
fi
}
create_symlink "$DOTFILE_PATH"/dot-profile ~/.profile FORCE
create_symlink "$DOTFILE_PATH"/dot-tmux.conf ~/.tmux.conf FORCE
create_symlink "$DOTFILE_PATH"/dot-tmux ~/.tmux
create_symlink "$DOTFILE_PATH/dot-config/nvim" ~/.config/nvim
create_symlink "$DOTFILE_PATH/dot-zshrc" ~/.zshrc FORCE