-
Notifications
You must be signed in to change notification settings - Fork 0
/
install
executable file
·71 lines (59 loc) · 1.79 KB
/
install
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/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)
echo "Installing brew modules via 'brew.sh'"
sh ./brew.sh
echo "'brew.sh' completed"
echo "Installing brew-cask modules via 'brew-cask.sh'"
sh ./brew-cask.sh
echo "'brew-cask.sh' completed"
echo "Config Mac via 'config.sh'"
sh ./config.sh
echo "'config.sh' completed"
# Check for .dotfiles file and add symlink
dotfiles="$HOME/.dotfiles"
if [ -L $dotfiles ]; then
echo "Removing existing $dotfiles symlink"
rm $dotfiles
fi
if [ -d $dotfiles ]; then
echo "Found existing $dotfiles folder. Skipping directory."
else
echo "Linking $DIR => $dotfiles"
ln -s "$DIR" "$dotfiles"
fi
# Recursively map dotfiles 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 ]; then
echo -e "Kept existing:\t$d"
else
ln -s "$d" "$c"
echo -e "Link created:\t$d"
fi
done < <(find "$DIR" \( -iname ".*" ! -iname ".dotfiles" ! -iname ".gitignore" ! -iname ".git" ! -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
# Load up new bash profile
echo "Loading Bash Profile"
source ~/.bash_profile
if [ ! -f "$HOME/.vim/autoload/plug.vim" ]; then
curl -sfLo ~/.vim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
fi
if [ ! -d "$HOME/.tmux/plugins/tpm" ]; then
git clone https://github.com/tmux-plugins/tpm "$HOME/.tmux/plugins/tpm" --quiet
if ! { [ "$TERM" = "screen" ] && [ -n "$TMUX" ]; } then
tmux source-file "$HOME/.tmux.conf"
fi
fi