-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathinstall.sh
executable file
·40 lines (33 loc) · 985 Bytes
/
install.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
#!/bin/bash
RED="\033[01;31m"
YELLOW="\033[01;33m"
GREEN="\033[01;32m"
BLUE="\033[01;34m"
WHITE="\033[00m"
git clone https://github.com/gmarik/vundle.git vim/bundle/vundle
for name in *; do
# ignore ourself
if [ "$name" = "install.sh" ]; then
continue
fi
# ignore update script
if [ "$name" = "update_submodules.sh" ]; then
continue
fi
target="$HOME/.$name"
# check if target already exists
if [ -e $target ]; then
if [ -L $target ]; then
echo -e "${YELLOW}Updating${WHITE} $target --> $PWD/$name"
rm $target
ln -s "$PWD/$name" "$target"
else
# we don't want to clobber existing files
echo -e "${RED}WARNING:${WHITE} $target exists but is not a symlink. Skipping.."
fi
else
# target doesn't exist, just make it
echo -e "${GREEN}Creating${WHITE} $target --> $PWD/$name"
ln -s "$PWD/$name" "$target"
fi
done