-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap.sh
More file actions
executable file
·52 lines (48 loc) · 1.19 KB
/
Copy pathbootstrap.sh
File metadata and controls
executable file
·52 lines (48 loc) · 1.19 KB
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
50
51
52
#!/bin/bash
cd "$(dirname "$0")"
git pull
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
EXCLUDED=( ".brew" ".git" ".DS_Store" "bootstrap.sh" "README.md" "init" ".osx" )
function createLinks() {
for file in `ls -A $DIR/`
do
echo $file
if (! isExcluded $file)
then
if [ -d "$file" ] ; then
ln -fs $DIR/$file $HOME
echo "Directory symlink created for $file"
else
ln -fs $DIR/$file $HOME/$file
echo "Symlink created for $file"
fi
fi
done
}
function isExcluded() {
for i in ${EXCLUDED[@]}
do
if [ $i == $1 ]
then
return 0
fi
done
return 1
}
if [ "$1" == "--force" -o "$1" == "-f" ]; then
createLinks
else
read -p "This may overwrite existing files in your home directory. Are you sure? (y/n) " -n 1
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
createLinks
fi
fi
unset createLinks
unset isExcluded
source ~/.zsh_profile
# Set up Dein for VIM
curl https://raw.githubusercontent.com/Shougo/dein.vim/master/bin/installer.sh > installer.sh
mkdir ~/.vim/bundles
sh ./installer.sh ~/.vim/bundles
rm -f ./installer.sh