-
Notifications
You must be signed in to change notification settings - Fork 5
/
install.sh
executable file
·44 lines (37 loc) · 1.17 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
#!/bin/bash
set -eux
echo "======================================"
echo "Setting up your mac using setup-my-mac"
echo "======================================"
# install brew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
# adding brew to path
eval "$(/opt/homebrew/bin/brew shellenv)"
# install git
brew install --quiet git
echo "Git installed..."
brew install --quiet [email protected]
echo "Python installed..."
# install pip
pip3.10 --version || python3 -m ensurepip --upgrade
echo "Pip installed..."
sudo mkdir -p /usr/local/bin
sudo ln -sf /opt/homebrew/Cellar/[email protected]/3.10.*/bin/pip3.10 /usr/local/bin/
# install ansible
pip3.10 install --user ansible
echo "Ansible installed..."
sudo ln -sf ~/Library/Python/3.10/bin/ansible* /usr/local/bin/
installdir="/tmp/setup-my-mac-$RANDOM"
mkdir $installdir
git clone https://github.com/aditya-mittal/setup-my-mac.git $installdir
if [ ! -d $installdir ]; then
echo "Failed to find setup-my-mac."
echo "git clone failed"
exit 1
else
cd $installdir
ansible-playbook -i ./hosts playbook.yml --verbose
fi
echo "Cleaning up..."
rm -Rfv /tmp/$installdir
echo "Voila! We are done!"