-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·40 lines (34 loc) · 823 Bytes
/
setup.sh
File metadata and controls
executable file
·40 lines (34 loc) · 823 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
#!/usr/bin/env bash
set -e
set -u
OS="`uname`"
SCRIPT_LOCATION="`pwd`"
function link {
move_original $2
ln -sf $SCRIPT_LOCATION/$1 $2
echo "Symlinked $2 to $1"
}
function move_original {
if [ -f $1 ] || [ -d $1 ]; then
mv $1 $1.local
fi
}
if [[ `readlink ~/.bashrc` == $SCRIPT_LOCATION/bash/bashrc ]]; then
echo "bash files already configured"
else
link bash/bashrc ~/.bashrc
link bash/bash_alias ~/.bash_alias
link bash/bash_profile ~/.bash_profile
fi
if [[ `readlink ~/.gitconfig` == $SCRIPT_LOCATION/git/gitconfig ]]; then
echo "Git already configured"
else
link git/gitconfig ~/.gitconfig
link git/gitignore ~/.gitignore
fi
if [[ `readlink ~/.vim` == $SCRIPT_LOCATION/vim ]]; then
echo "Vim already configured"
else
link vim ~/.vim
link vim/vimrc ~/.vimrc
fi