-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
路92 lines (79 loc) 路 1.8 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
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
83
84
85
86
87
88
89
90
91
92
#!/bin/bash
function yes-no() {
read -p "$1 [y/n]" -n 1 -r
echo '' # make sure we're on a newline
[ $REPLY == "y" ] && return 0 || return 1
}
if [[ ! $(xcode-select -p) ]]; then
$(xcode-select --install)
yes-no 'Did Xcode install successfully?' || exit 1
fi
if [[ ! -x /usr/local/bin/brew ]]; then
echo "Install homebrew"
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
function brew-all {
function may-brew {
printf "%-50s" $1
if brew ${assert} -1 | grep -q $(echo $1 | sed 's/caskroom\/cask\///'); then
printf "%30s\n" '[OK]'
else
printf "%30s\n\n" '[INSTALLING]'
brew ${action} $1
printf "\n\n"
fi
return 0
}
function many-brew {
printf "\nbrew $2\n\n"
local assert=$1
local action=$2
for item in ${brews[@]}; do
may-brew $item
done
}
local brews=(
caskroom/fonts
)
many-brew 'tap' 'tap'
local brews=(
autojump
caskroom/cask/brew-cask
cloc
ctags
git
grep
readline
reattach-to-user-namespace
the_silver_searcher
tmux
vim
wget
zsh
)
many-brew 'list' 'install'
local brews=(
1password
disk-inventory-x
dropbox
font-inconsolata
iterm2
java
skype
slack
spectacle
)
many-brew 'cask list' 'cask install'
} && brew-all
cd lib
for entry in *; do
ln -Ffs .dotfiles/lib/$entry $HOME/.$entry
done
cd ..
vundle="$PWD/lib/vim/bundle/vundle.vim"
[ -a $vundle ] || (git clone git@github.com:gmarik/Vundle.vim.git $vundle && \
vim +PluginInstall +qall) # Fetch and install all bundles included in vimrc
oh_my_zsh="$PWD/oh-my-zsh"
[ -a $oh_my_zsh ] || git clone git@github.com:robbyrussell/oh-my-zsh.git $oh_my_zsh
ln -Ffs .dotfiles/id_rsa.pub $HOME/.ssh/.id_rsa.pub
chsh -s "$(which zsh)"