-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·49 lines (41 loc) · 917 Bytes
/
setup.sh
File metadata and controls
executable file
·49 lines (41 loc) · 917 Bytes
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
#!/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 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
linkDotfile rgignore
for item in config/*; do
linkDotfile "$item"
done