forked from geerlingguy/mac-dev-playbook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
start.sh
54 lines (40 loc) · 1.19 KB
/
start.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
#!/bin/bash
# script to bootstrap setting up a mac with ansible
function uninstall {
echo "WARNING : This will remove homebrew and all applications installed through it"
echo -n "are you sure you want to do that? [y/n] : "
read confirmation
if [ $confirmation == "y" ]; then
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
exit 0
else
echo "keeping everything intact"
exit 0
fi
}
if [ $1 == "uninstall" ]; then
uninstall
fi
echo "==========================================="
echo "Setting up your mac using codeHorse87/mac-dev-playbook"
echo "==========================================="
xcode-select --install
brew install python3
sudo easy_install pip
sudo pip3 install ansible
installdir="/tmp/setupmac-$RANDOM"
mkdir $installdir
git clone https://github.com/codeHorse87/mac-dev-playbook.git $installdir
if [ ! -d $installdir ]; then
echo "failed to find setupmac."
echo "git cloned failed"
exit 1
else
cd $installdir
ansible-galaxy install -r requirements.yml
ansible-playbook main.yml -i inventory -K --verbose
fi
echo "cleaning up..."
rm -Rfv /tmp/$installdir
echo "and we are done! Enjoy!"
exit 0