-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·44 lines (36 loc) · 1.07 KB
/
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
41
42
43
44
#!/bin/bash
for f in "$PWD"/*; do
# Get filename
FILE="${f##*/}"
# Make sure file isn't this file, an archived file, or the README
if [[ "$FILE" != *.sh && "$FILE" != *.old && "$FILE" != "README.md" ]]; then
BASEFILE=$HOME/.$FILE
if [ -f $BASEFILE -a ! -h $BASEFILE ]; then
echo "File exists: .$FILE, archiving to $FILE.old"
mv $BASEFILE $f.old
elif [ -h $BASEFILE ]; then
rm $BASEFILE
else
echo "Creating link: .$FILE"
fi
ln -s $f $BASEFILE
fi
done
# Delete any stale links, if any
for f in ~/.*; do
# Only look at links
[ ! -h $f ] && continue
if [ ! -f $f -a ! -d $f ]; then
FILE="${f##*/}"
echo "Deleting stale link: $FILE"
rm $f
fi
done
# Install Vundle if needed
if [ ! -d ~/.vim/bundle/Vundle.vim ]; then
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
echo "Vundle installed to ~/.vim/bundle/Vundle.vim"
fi
echo "Installing Vim plugins..."
vim +PluginInstall +qall
echo "...done!"