-
Notifications
You must be signed in to change notification settings - Fork 3
/
install.sh
executable file
·38 lines (34 loc) · 1.04 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
if ! command -v realpath &> /dev/null; then
realpath() {
OURPWD=$PWD
cd "$(dirname "$1")"
LINK=$(readlink "$(basename "$1")")
while [ "$LINK" ]; do
cd "$(dirname "$LINK")"
LINK=$(readlink "$(basename "$1")")
done
REALPATH="$PWD/$(basename "$1")"
cd "$OURPWD"
echo "$REALPATH"
}
fi
basedir=$(dirname $(realpath $0))
ln -s $basedir/.alacritty.yml ~/.alacritty.yml
mkdir -p ~/.vim/autoload
ln -s $basedir/.vim/autoload/plug.vim ~/.vim/autoload/plug.vim
ln -s $basedir/.vimrc ~/.vimrc
ln -s $basedir/.tmux.conf.local ~/.tmux.conf.local
ln -s $basedir/.zshrc ~/.zshrc
ln -s $basedir/.gdbinit ~/.gdbinit
ln -s $basedir/.ssh/config.envconf.d ~/.ssh/config.envconf.d
mkdir ~/.ssh/.s
if [ -d "$basedir/_private" ]; then
ln -s $basedir/_private/.ssh/config ~/.ssh/config
else
if ! grep -q 'config\.envconf\.d' ~/.ssh/config; then
sed -i '1s|^|Include config.envconf.d/*.conf\n|' file
fi
fi
if [ ! -f ~/.zshrc.local ]; then
cp $basedir/.zshrc.local.template ~/.zshrc.local
fi