-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbootstrap.sh
executable file
·82 lines (65 loc) · 1.57 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#setup/bash_profile
# Global vars
#############
OSS=~/Code/OSS
DOTFILES=~/dotfiles
# Helper functions
##################
todo() {
echo "TODO: $1"
}
clone() {
org=$1
repo=$2
dir=$OSS/$repo
[[ -d $dir ]] || git clone https://github.com/$org/$repo.git $dir
}
# Color scheme
##############
clone dracula terminal-app
theme=`defaults read com.apple.Terminal "Default Window Settings"`
if [[ ! $theme == "Dracula" ]]; then
echo "Install Dracula terminal theme? yN"
read
if [[ $REPLY == "y" ]]; then
echo "Set it as default in Terminal.app preferences"
sleep 1
open $OSS/terminal-app/Dracula.terminal
fi
fi
# Symlink dotfiles
##################
symlink() {
link=~/.$1
actual=~/dotfiles/$1
[[ -L $link ]] || ln -s $actual $link
}
symlink aliases
symlink gitconfig
symlink tmux.conf
symlink vimrc
symlink vim/autoload
ln -s $DOTFILES/git/gitignore_global ~/.gitignore
# Homebrew
##########
installHomebrew() {
if ! [[ `which brew` ]]; then
echo "Installing homebrew..."
/bin/bash -c "`curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh`"
fi
}
installBrews() {
echo "Updating brews..."
for pkg in `cat $DOTFILES/BREWS`; do
[[ `brew ls --versions $pkg` ]] || HOMEBREW_NO_AUTO_UPDATE=1 brew install "$pkg"
done
}
installCasks() {
echo "Updating casks..."
for pkg in `cat $DOTFILES/CASKS`; do
[[ `brew ls --cask --versions $pkg` ]] || HOMEBREW_NO_AUTO_UPDATE=1 brew install --cask "$pkg"
done
}
installHomebrew
installBrews
installCasks