forked from geerlingguy/mac-dev-playbook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
46 lines (37 loc) · 1.02 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
!#/bin/bash
if ! command -v cc >/dev/null; then
echo "Installing xcode ..."
xcode-select --install
else
echo "Xcode already installed. Skipping."
fi
if [[ -z $(which brew) ]]; then
echo "Installing Homebrew...";
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)";
fi
if [[ -z $(which ansible) ]]; then
echo "Installing Ansible";
brew install ansible;
fi
if [[ -d ~/.dotfiles ]]; then
echo "Updating dotfiles";
cd ~/.dotfiles;
git pull origin master;
else
echo "Cloning dotfiles"
git clone https://github.com/kinigitbyday/dotfiles.git ~/.dotfiles > /dev/null;
fi
if [[ -d ~/.setup ]]; then
echo "Updating playbook";
cd ~/.setup;
git pull origin master;
else
"Cloning playbook"
git clone https://github.com/kinigitbyday/mac-dev-playbook.git ~/.setup > /dev/null;
fi
cd ~/.setup/;
echo "Installing requirements";
ansible-galaxy install -r ./requirements.yml;
echo "Initiating playbook";
ansible-playbook ./main.yml -i inventory -K;
echo "Done.";