-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall
More file actions
executable file
·47 lines (40 loc) · 1.08 KB
/
install
File metadata and controls
executable file
·47 lines (40 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
#! /bin/zsh
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# zsh configs
if [ -f ~/.zshrc ]
then
local zshrc_local="$HOME/.zshrc.local"
if [ -z "$(cat $HOME/.zshrc | grep "source $zshrc_local")" ]
then
echo "source $zshrc_local" >> "$HOME/.zshrc"
fi
ln -sf "$CURRENT_DIR/zsh/.zshrc" "$zshrc_local"
else
ln -sf "$CURRENT_DIR/zsh/.zshrc" "$HOME/.zshrc"
fi
# macos zshrc
if [ -f "$CURRENT_DIR/zsh/.zshrc.mac" ]
then
local zshrc_mac="$HOME/.zshrc.mac"
if [ -z "$(cat "$HOME/.zshrc.local" | grep "source $zshrc_mac")" ]
then
echo "source $zshrc_mac" >> "$HOME/.zshrc.local"
fi
ln -sf "$CURRENT_DIR/zsh/.zshrc.mac" "$zshrc_mac"
fi
source "$HOME/.zshrc"
# tmux configs
ln -sf "$CURRENT_DIR/tmux/.tmux.conf" "$HOME/.tmux.conf"
tmux source "$HOME/.tmux.conf"
# git configs
if [ -f "$HOME/.gitconfig" ] && [ ! -L "$HOME/.gitconfig" ]
then
mv "$HOME/.gitconfig" "$HOME/.gitconfig.local"
fi
ln -sf "$CURRENT_DIR/git/.gitconfig" "$HOME/.gitconfig"
# nvim configs
if [ -f ~/.config/nvim ]
then
rm ~/.config/nvim
fi
ln -sfn "$CURRENT_DIR/nvim" "$HOME/.config/nvim"