-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall.sh
executable file
·49 lines (43 loc) · 1.34 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
45
46
47
48
49
#!/usr/bin/env bash
# Get path to script folder
DIR="$( cd "$( dirname "$0" )" && pwd )"
# Fix path in case of symlinks
DIR=$(cd "$DIR" && pwd -P)
# Check for .dots file and add symlink
dotfiles="$HOME/.dots"
if [ -L $dotfiles ]; then
echo "Removing existing dotfiles symlink."
rm $dotfiles
fi
if [ -d $dotfiles ]; then
echo "Keeping existing $dotfiles folder."
else
echo "Linking $DIR => $dotfiles"
ln -s "$DIR" "$dotfiles"
fi
# Recursively map dotfiles/dotdirs to home directory
echo "Installing individual dotfiles..."
while IFS= read -d $'\0' -r file ; do
b=$(basename $file)
c="$HOME/$b"
d="$file"
if [ -L $c ]; then
rm $c
fi
if [ -f $c -o -d $c ]; then
echo -e "Kept existing:\t$d"
else
ln -s "$d" "$c"
echo -e "Link created:\t$d"
fi
done < <(find "$DIR" \( -type f -or -type d \) \( -path "$DIR/*/.vim" -prune -o -path "$DIR/.git" -prune -o -path "$DIR/*/.git" -prune \) -o \( -iname ".*" ! -iname ".gitignore" ! -iname ".gitmodules" ! -iname "*.swp" \) -print0)
# Throw in a localrc if needed
if [ ! -e $HOME/.localrc ]; then
echo -e "# This is your own .localrc file for your SUPER SECRET STUFF" > $HOME/.localrc
fi
# SPF13
echo "Installing spf13-vim!"
source $DIR/.spf13-vim-3/bootstrap.sh
# OH-MY-ZSH
echo "Installing oh-my-zsh!"
source $DIR/.oh-my-zsh/tools/install.sh