-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsetup.sh
executable file
·46 lines (39 loc) · 895 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash
dotfilesDir=$(pwd)
function linkDotfile {
dest="${HOME}/.${1}"
dateStr=$(date +%Y-%m-%d-%H%M)
if [ -h ~/.${1} ]; then
# Existing symlink
rm ${dest}
elif [ -f "${dest}" ]; then
# Existing file
echo "Backing up existing file: ${dest}"
mv ${dest}{,.${dateStr}}
elif [ -d "${dest}" ]; then
# Existing dir
echo "Backing up existing dir: ${dest}"
mv ${dest}{,.${dateStr}}
fi
echo "Linking ${dest}"
ln -s ${dotfilesDir}/${1} ${dest}
}
mkdir -p ~/.vim
mkdir -p ~/.config
linkDotfile bash_profile
linkDotfile bin
linkDotfile config/nvim
linkDotfile config/pypoetry
linkDotfile ctags
linkDotfile direnvrc
linkDotfile git_hooks
linkDotfile gitconfig
linkDotfile gitignore
linkDotfile netrc
linkDotfile tmux.conf
linkDotfile vim/autoload
linkDotfile vim/plug
linkDotfile vim/snippets
linkDotfile vimrc
linkDotfile zshrc
linkDotfile zshrc.d