-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·42 lines (31 loc) · 781 Bytes
/
setup.sh
File metadata and controls
executable file
·42 lines (31 loc) · 781 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
#!/usr/bin/env bash
DIR=$HOME/dotfiles
pushd $DIR
echo "Initializing submodules"
git submodule update --init
# Copies to ~ if file doesnt exist, sources otherwise
install_file() {
if [ -f ~/$1 ]; then
echo $1 "exists, appending to it"
echo "source ~/dotfiles/$file" >> ~/$file
else
echo "Installing $1"
ln ~/dotfiles/$file ~/$file
fi
}
echo "Creating dotfile links on ~/"
files=".bashrc .vimrc .gitignore .inputrc .gvimrc .tmux.conf .zshrc"
dirs=".vim"
for file in $files; do
install_file $file
done
for dir in $dirs; do
if [ -f ~/$dir ]; then
echo $dir "exists. Ignoring."
else
echo "Installing "$dir
ln -s ~/dotfiles/$dir ~/$dir
fi
done
git config --global core.excludesfiles ~/.gitignore
echo "...done"