-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbootstrap
executable file
·44 lines (34 loc) · 981 Bytes
/
bootstrap
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
#!/usr/bin/env bash
set -e
export PATH=/usr/local/bin:$PATH
installDir=$HOME/.mac-setup/src
binPath=/usr/local/bin/mac-setup
function printInfo() {
YELLOW='\033[0;33m'
NC='\033[0m' # No Color
echo -e "${YELLOW}$@${NC}"
}
printInfo Installing xcode
if [[ $(/usr/bin/gcc 2>&1) =~ "no developer tools were found" ]] || [[ ! -x /usr/bin/gcc ]]; then
xcode-select --install
fi
printInfo Installing homebrew
if [[ ! -x /usr/local/bin/brew ]]; then
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
printInfo Installing ansible
if [[ ! -x /usr/local/bin/ansible ]]; then
brew install ansible
fi
printInfo Installing git
if [[ ! -x /usr/local/bin/git ]]; then
brew install git
fi
printInfo Downloading code
if [[ ! -x $installDir ]]; then
git clone git@github.com:fefas/mac-setup.git $installDir
fi
printInfo Creating link $binPath
if [[ ! -x $binPath ]]; then
sudo ln -s $installDir/run $binPath
fi