-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
executable file
·48 lines (42 loc) · 962 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
47
#!/bin/bash
test -t 1 && {
C_PREFIX='\033[1;31m'
C_SUFFIX='\033[0m'
}
# symlink for brew bash completion
which brew &>/dev/null && {
BREW_PREFIX=$(brew --prefix)
brew ls bash-completion >/dev/null && {
test ! -e $BREW_PREFIX/etc/bash_completion.d/brew_bash_completion.sh && {
echo "ln -s $BREW_PREFIX/Library/Contributions/brew_bash_completion.sh \\"
echo " $BREW_PREFIX/etc/bash_completion.d/brew_bash_completion.sh"
}
}
}
DOT_FILES=(
.bash_completion
.bash_completion.d
.bash_profile
.bashrc
.bashrc.d
.digrc
.dir_colors
.gitconfig
.gitignore
.inputrc
.rspec
.tmux.conf
.vim
.vimrc
)
for file in ${DOT_FILES[@]} ; do
src=$PWD/$file
dst=$HOME/$file
if [ ! -e $src ] ; then
echo -e "# ${C_PREFIX}Warning${C_SUFFIX}: missing $src"
elif [ -e $dst ] ; then
echo -e "# ${C_PREFIX}Warning${C_SUFFIX}: exists $dst"
else
echo "ln -s $src $dst"
fi
done