forked from mathiasbynens/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap.sh
executable file
·48 lines (43 loc) · 1.24 KB
/
bootstrap.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
#!/usr/bin/env bash
cd "$(dirname "${BASH_SOURCE}")";
# git pull origin master; # I'll be pulling in manually anyway so this is redundant
function doIt() {
# Install oh-my-zsh if not installed already
if [ -d "~/.oh-my-zsh" ]; then
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
fi
# Install the powerline fonts
git submodule init
git submodule update
(cd fonts && ./install.sh)
# Install personal overrides to oh-my-zsh
rsync -avh --no-perms ./ohmyzsh_custom/ ~/.oh-my-zsh/
# Install all the other stuff
rsync --exclude ".git/" \
--exclude ".DS_Store" \
--exclude ".osx" \
--exclude ".macos" \
--exclude "fonts" \
--exclude "ohmyzsh_custom" \
--exclude "brew.sh" \
--exclude "bootstrap.sh" \
--exclude "README.md" \
--exclude "LICENSE-MIT.txt" \
-avh --no-perms . ~;
# Read the new configurations
if [ "$$" == "-zsh" -o "$$" == "zsh" ]; then
source ~/.zshrc;
elif [ "$$" == "-bash" -o "$$" == "bash" ]; then
source ~/.bash_profile;
fi;
}
if [ "$1" == "--force" -o "$1" == "-f" ]; then
doIt;
else
read -p "This may overwrite existing files in your home directory. Are you sure? (y/n) " -n 1;
echo "";
if [[ $REPLY =~ ^[Yy]$ ]]; then
doIt;
fi;
fi;
unset doIt;